Cross-posting.. I initially thought this problem was caused by Migrating sites from 9.x to 10.x, but no.
I CANNOT BELIEVE such a STUPID bug has not been detected.
---------------------------------------------------------------
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
Parallels Plesk Panel, 10.3.1, RHEL6.1, x86-64
PROBLEM DESCRIPTION AND STEPS TO REPRODUCE
When FastCGI is turned on, subdomains can't use PHP sessions because they cannot write to /var/lib/php/session.
Steps:
1- Create domain
2- Create subdomain
3- Create a simple PHP file that uses sessions under the subdomain:
ACTUAL RESULT
Session to work properly. Some limitation prevents accessing /var/lib/php/session, as chmod 777 does not help.
ANY ADDITIONAL INFORMATION
Workaround:
Insert this to the _httpd.include file for the subdomain vhost config:
BUT with the above workaround there are more errors because the custom php ini refers to directories specific for the main site not the subdomain.
--------------------------------------------------------------
I CANNOT BELIEVE such a STUPID bug has not been detected.
---------------------------------------------------------------
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
Parallels Plesk Panel, 10.3.1, RHEL6.1, x86-64
PROBLEM DESCRIPTION AND STEPS TO REPRODUCE
When FastCGI is turned on, subdomains can't use PHP sessions because they cannot write to /var/lib/php/session.
Steps:
1- Create domain
2- Create subdomain
3- Create a simple PHP file that uses sessions under the subdomain:
<?
session_start();
?>
ACTUAL RESULT
EXPECTED RESULT[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
Session to work properly. Some limitation prevents accessing /var/lib/php/session, as chmod 777 does not help.
ANY ADDITIONAL INFORMATION
Workaround:
Insert this to the _httpd.include file for the subdomain vhost config:
SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/tst/etc/php.ini
<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/tst/etc/php.ini
</IfModule>
BUT with the above workaround there are more errors because the custom php ini refers to directories specific for the main site not the subdomain.
--------------------------------------------------------------
Last edited: