Social Icons

Sunday, October 20, 2013

Call to a member function set_userdata() on a non-object: Codeigniter

Once I was using sessions in codeigniter and got the above error "Call to a member function set_userdata() on a non-object. Later I fixed it and providing the same solution for it. 

This error comes in codeigniter if you haven't loaded session library in your file or project. You can do it in two ways. You can either load the session library in the file itself or autoload session library in autoload.php

Load the session library in the file as follows: 
$this->load->library('session');

Or you can autoload session library as follows: 
$autoload['libraries'] = array('database', 'session');

This should fix your error.

In order to use the Session class you are required to set an encryption key in your config file

This error code belongs to codeigniter (PHP MVC framework). Once I upgraded my codeigniter and while using session in codeigniter, I got the error as : "In order to use the session class you are required to set an encryption key in your config file". Here, I am providing the solution for this error. I fixed it as follows:

The reason they ask for an encryption key is security. Even if you are not using encrypted sessions, you must set an encryption key in your config file which is used to aid in preventing session data manipulation. So, you have to change in config.php as:

$config['encryption_key'] = 'your_encryption_key_here';

This should fix your error.

Tuesday, October 8, 2013

Maximum execution time of 60 seconds exceeded: Magento

Once I was in the stage of installing magento on my machine and got this error: maximum execution time of 60 seconds exceeded. And then later I fixed it. I am just sharing the thing that I do and is required to fix the above error.

Open your php.ini configuration file (It will be inside php folder). Search for max_execution_time there in the file. Assign it the value of 1800. So, it will be now max_execution_time = 1800. Similarly, just below that there will be max_input_time. Assign it also the same value as 1800. Save the file and restart your wamp or xampp server whatever you are using. That should fix the error.

Total Pageviews