set_flashdata() triggers a fatal error in PyroCMS - codeigniter

I moved a Pyrocms site to another server.
Go to index: blank page.
Turn on errors: get this
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Pages::$session
Filename: core/Model.php
Line Number: 50
Fatal error: Call to a member function set_flashdata() on a non-object in /var/www/vhosts/brokentalkers.com/httpdocs/system/pyrocms/modules/modules/models/module_m.php on line 193
If it sheds any light, I made a tar.gz of the contents of the old httpdocs folder, and extracted it in the new httpdocs folder.
I made a duplicate of the database with an identical user, so config/database.php shouldn't need changing.
Any ideas? Thanks in advance.

It seems like $session class is not initializing correctly.
Check for default_ci_sessions table, if you are using sessions for database.
Check if the constructor is loading sessions library.
Check if session is in autoload.php config

Related

Codeigniter - Sparks to composer, activerecord issues now

So I have just gone through a update going from CI 2.0.4 to 3.1.4 and ran into the issue with Sparks now being redundant I've had to move onto composer to get php active record working..
however I have had autoloading issues/ Solved by including the model directly into the controller ie: require_once(APPPATH.'models/User.php');
But now im getting the following error..
An uncaught Exception was encountered
Type: ActiveRecord\DatabaseException
Message: Empty connection string
Filename: /var/www/html/vendor/php-activerecord/php-activerecord/lib/Connection.php
Line Number: 105
btw to load the composer autoload I've put: config['composer_autoload'] = '../vendor/autoload.php'; as the vendor directory sits outside the application folder in its parents folder.
Any help would be greatly appreciated..
You can move the vendor directory to your public_html/www and try
config['composer_autoload'] = FCPATH.'vendor/autoload.php';

Unable to unlink files from CI's asset folder

I am asking this question over here with the hope that it would be solved by somebody.I have a project in Codeigniter v3.1.3.In the assets/admin/uploads/photostory_img directory i have some image files which i am trying to delete using the 'unlink' method.My unlink code in the Controller is like :
unlink("assets/admin/uploads/photostory_img/".$ps_old_img);
However, i'm getting errors like:
A PHP Error was encountered
Severity: Warning
Message: unlink(assets/admin/uploads/photostory_img/): Permission denied
Filename: nautics/Pstory.php
Line Number: 293
Backtrace:
File: C:\wamp64\www\JSNCI\application\controllers\nautics\Pstory.php
Line: 293
Function: unlink
File: C:\wamp64\www\JSNCI\index.php
Line: 315
Function: require_once
I have searched all over the internet and SO also having similar question , but no success yet.Pleas help me.Its driving me crazy.
Seems you don't have anything in your $ps_old_image var so you are trying to delete directory with unlink. Check what's inside your variable.
Second problem may be your path. I use unlink in my projects and I delete files with something like:
unlink("./assets/admin/uploads/photostory_img/".$ps_old_img);
Of course it depends on your certain situation, where do you have your index.php.

Fatal error while exporting a CSV file from webpage

I'm trying to export an cvs file but I'm having this error.
Fatal error: Call to undefined method
Mage_Adminhtml_Model_System_Config_Source_Yesno::setAttribute() in
/home/acdistri/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php
on line 389
thanks for your quick interest in this question... I found the solution... when I install a extension it create an Attribute, then I uninstall the extension because a JavaScript conflict but the attribute stay there and when I was trying to do the export of the products data base it give me that error. I just delete the attribute and now is working all fine.

Laravel new command error

I did the following commands:
composer global require "laravel/installer=~1.1"
and
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
But when I try to do:
laravel new blog
I get the following error:
Notice: Undefined variable: output in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Fatal error: Call to a member function writeln() on null in C:\Users\****\AooDara\Roaming\Composer\vendor\laravel\installer\src\NewCommand.php on line 55
Any idea of what went wrong?
Seems like you already have a directory called 'blog' in your application directory. Try creating a laravel app with different name or delete / rename existing 'blog' directory and try again.
for example laravel new helloapp.
However, I think the error showing at the console is a bug of laravel new command. I could see the error at the console when I tried to create a app with same name again from same directory.
The error not exists now. Try creating other application.

CodeIgniter transfer from WAMP to host subfolder error

I was creating a simple CodeIgniter site on my WAMP and all runs well.
But when uploaded to the host it says CI_Controller not found in CodeIgniter.php
Fatal error: Class 'CI_Controller' not found in /home/<myhost>/public_html/pms/system/core/CodeIgniter.php on line 233
I checked all the paths and seems right, i even went to the CodeIgniter.php file.
My database was migrated from local to the host, config was set, still this error comes out.
Is there something I'm missing? I really cant find anything on the net that could allow me to understand why it returns an error.
Hope someone could help understand this.
Thanks.
CodeIgniter will most probably figure out the base_url by itself:
$config['base_url'] = '';
... should work.
Fatal error: Class 'CI_Controller' not found in /home//public_html/pms/system/core/CodeIgniter.php on line 233
The path is not correct /home/public_html/pms/system/core/CodeIgniter.php

Resources