• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Bug: Migrate site from 9.x to 10.x, subdomains can't use PHP session with FastCGI

bluik

Basic Pleskian
I had a server running the latest 9.x series Plesk.
I migrated a site with several (20) subdomains to latest Plesk 10.x with FastCGI turned on.

All subdomains cannot use PHP sessions.
It seems to be some kind of bug concerning only the migrated subdomains.
If I create a simple test file (sess.php) /var/www/vhosts/example.com/httpdocs:
<?
session_start();
?>
And run it under the main domain (http://example.com/sess.php), it works - no errors at error_log.
If I then move this same test file (sess.php) to one of the migrated subdomains, say /var/www/vhosts/example.com/subdomains/test/httpdocs and try to run it (http://test.example.com/sess.php) it does not work, unable to write to /var/lib/php/sessions. I even chmod 777 this directory for testing but it does not help.

Errors:

[Mon Aug 01 07:16:27 2011] [warn] [client 192.0.2.1 mod_fcgid: stderr: PHP Warning: session_start(): open(/var/lib/php/session/sess_ko4dsk6kjrav9f28m1pbuo8um6, O_RDWR) failed: Permission denied (13) in /var/www/vhosts/example.com/subdomains/test/httpdocs/sess.php on line 2
[Mon Aug 01 07:16:27 2011] [warn] [client 192.0.2.1] mod_fcgid: stderr: PHP Warning: Unknown: open(/var/lib/php/session/sess_ko4dsk6kjrav9f28m1pbuo8um6, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[Mon Aug 01 07:16:27 2011] [warn] [client 192.0.2.1] mod_fcgid: stderr: PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0

What to do? I have tons of sites I need to migrate to Plesk 10, and most of them are using Joomla. So it would be a great hassle to move them manually to different directories (need to reconfig Joomla a lot).


EDIT:
Seems the problem is missing custom php.ini. The main site in conf/<long random number string created by PMM>_httpd.include has the following:

SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/tst.khmerdev.com/etc/php.ini

<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/tst.khmerdev.com/etc/php.ini
</IfModule>

But any subdomain does not.
This means subdomains created with Plesk (not migrated) have the same problem. I am cross-posting this to "Troubleshooting" forum also.
 
Last edited:
Back
Top