Welcome Guest, Not a member yet? Register   Sign In
500 Internal Server Error Set Session Handler
#1

Hey everyone,

I've been using CI since the 1.x days and just had an opportunity to start a new project with 3.0. I'm getting a 500 error when the sessions library is loaded and I tracked it down to the session_set_save_handler($class, TRUE); (line 111 in /system/libraries/Session/Session.php). The 500 error occurs with the out of the box CI session settings, and with the following configurations:
(Database driver)
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'fhc_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

I created the sessions table in the database using a migration file and other than this session issue it appears CI is working fine.

(Files driver)
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'fhc_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = APPPATH.'sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

I created the sessions directory in APPPATH and set the permissions to 0700, 0755, 0770 with the same error.

My php.ini session.save_path is set to /tmp and other applications are creating sessions in the /tmp folder. There are CI 2.2 apps running on this server without any issues, as well as various Wordpress and Joomla apps. The specific user on the server with this issue also has a Joomla application and an osTicket application that are running fine.

The PHP version is 5.4.21 on Apache 2.2.25. This is running on a VPS.

The only clue on the 500 error is Premature end of script headers: index.php. I checked the suphp_log and there is nothing suspicious there ([Thu Apr 23 11:19:58 2015] [info] Executing "<<snip>>/index.php" as UID 529, GID 528). I checked httpd.conf for any mention of another PHP version to see if there was some issue with a PHP upgrade. I'm not sure what else to check. Has anyone run into anything like this? I searched the forums for session errors but didn't find anything that looked similar to what I'm running into.

Thanks for any help!
Reply
#2

I was able to get things working by upgrading PHP to 5.5.24. The Apache was due for an upgrade too, so that is now 2.4.12. Maybe if anyone else runs into this issue the information will be able to help them.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB