This is a simple step on how to fix the PHP session error “PHP Warning: session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php56)”
Cause of error
The error you are encountering, “Failed to read session data,” usually indicates an issue with session handling in PHP. More specifically there is no permission to write session data to the directory specified in the session.save_path line in your php.ini file or the file to write session data to does not exist.
Solution
- Solution 1: Upgrade PHP version
In the error URL, the part “ea-php56” refers to the PHP version that your system or script is using. Try to update the PHP version to another version and check if that fixes the problem. You can always return to the old PHP version if you are encountering any errors in your script or version.
What this solution does is that it updates the line “session.save_path = “/var/cpanel/php/sessions/ea-php56” in all php.ini files with the correct PHP version directory.
Reverting to the old PHP version will not result in the error reoccurring.
NOTE: If you are experiencing the error using a subdomain, check if the subdomain contains the php.ini file. If it is missing, create one, then update your PHP version for the subdomain.
- Solution 2: Restart Apache
If solution 1 does not work, try restarting Apache. If you do not have server root or WHM access, then you need to contact your host to have your Apache server restarted.
It is likely that the problems above occurred after a website migration or a change of server operating system. Most of the time, when you migrate a website to a new host or server, php.ini is not updated to reflect the correct PHP version your new host is using
Leave a Comment