SOLVED PHP ea-php73 website looking for ea-php70 session data

Nov 21, 2019
7
1
3
Australia
cPanel Access Level
Root Administrator
Hey guys,

I have started migrating my clients over to my new hosting setup at Amazon AWS. It's running the latest WHM.

Strange one - an e-commerce site that has user logins doesn't seem to log users in. Nothing happens.

Looks like it's looking for session data in ea-php70 when the website is running on ea-php73 as set by multi php manager. In fact the system doesn't even have ea-php70 installed at all.

Looking at the php error log, I get lots of this:

Code:
[29-Jan-2020 11:40:04 UTC] PHP Warning:  session_start(): open(/var/cpanel/php/sessions/ea-php70/sess_53117bec1fab08fa2f6b3332dcffeac3, O_RDWR) failed: No such file or directory (2) in /home/xxxxxx/public_html/xxxxxx.php on line 4
[29-Jan-2020 11:40:04 UTC] PHP Warning:  session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php70) in /home/xxxxxx/public_html/xxxxxxxx.php on line 4
What is stranger, is that the website also has a CMS/admin panel. And I seem to be able to log into that fine, and the sessions are managed fine.

Any help would be greatly appreciated.

Kind regards,

Scott
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
Hello,

What is listed in the php.ini file for session.save_path ?

Most likely you'd find this (depending on your configuration) in cPanel>>Software>>MultiPHP INI Editor

You can create a php info page to get this information (importanly whether the value is set locally or globally for that version of PHP) as well as the .ini file files loaded into the configuration

You may also want to check the following:

/home/$user/public_html/.htaccess
/home/user/public_html/*.ini


Additionally, if you're using PHP-FPM you may want to check if this has been modified (by default it's not set so it uses the default values) Configuration Values of PHP-FPM | cPanel & WHM Documentation
 
Nov 21, 2019
7
1
3
Australia
cPanel Access Level
Root Administrator
OK, I ran phpinfo() and I think I see the issue. A difference between local and master values for session.save_path:

Local: /var/cpanel/php/sessions/ea-php70

Master: /var/cpanel/php/sessions/ea-php73

How should I get PHP-FPM and this machine to honour the Master value?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,304
1,252
313
Houston
So, before you make any changes to the php-fpm config, when you look at the .ini files local to that domain (since this is clearly set locally) as well as the .htaccess do you see anything that references the session save path?
 
Nov 21, 2019
7
1
3
Australia
cPanel Access Level
Root Administrator
OMG - so just looked through the website files and I found a user generated .user.ini file which is setting the session path. It must have been done by a previous dev.

Can confirm the site is working as desired once I removed the user.ini file.

So, before you make any changes to the php-fpm config, when you look at the .ini files local to that domain (since this is clearly set locally) as well as the .htaccess do you see anything that references the session save path?
Yup this: session.save_path = "/var/cpanel/php/sessions/ea-php70"
 
Last edited:
  • Like
Reactions: cPanelLauren