Page 1 of 1

PHP session problem on Plesk after update

Posted: Sun Dec 26, 2010 2:09 pm
by Endimmion
Hi,


after upgrading my CentOS 5 / Plesk 9.5.4 with the php 5.2.16-1.el5.art release from Atomic repo, I've ended up with a write session problem with PHP.


The site that use the FastCGI module can't write session to /var/lib/php/session

/var/lib/php/session has 770 permission. In order to quickly fix the probleme I have set the permission to 777, but I think that's not a good solution, isn't it?

Re: PHP session problem on Plesk after update

Posted: Sun Dec 26, 2010 6:25 pm
by mneese77
I have the same elements as you and I have sessions at 770...can you tell me where you are seeing these errors reported so I can check mine...what are the symptoms of this write inability? Are the sites failing?

Re: PHP session problem on Plesk after update

Posted: Sun Dec 26, 2010 7:10 pm
by Endimmion
Here is an example of a session error

Code: Select all

[Sun Dec 26 18:01:35 2010] [warn] mod_fcgid: stderr: PHP Warning:  Unknown: open(/var/lib/php/session/sess_kv4u1j6ehbrml1uq0tf7el7326, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[Sun Dec 26 18:01:35 2010] [warn] 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
I found this error, in the "error_log", that is stored in "/var/www/vhosts/xxxx.com/statistics/logs"

This write inability make that sessions don't work in PHP

Re: PHP session problem on Plesk after update

Posted: Sun Dec 26, 2010 7:10 pm
by Endimmion
but are you using Plesk and FastCGI too?

Re: PHP session problem on Plesk after update

Posted: Mon Dec 27, 2010 1:36 pm
by mneese77
yes i am using plesk 9.5.4, and fast fgi...
I have looked at several joomla sites using fcgi, and the only time I see the error for sessions save path is a few times when installing the core joomla files, and I have made it a standard procedure to just set the tmp file to 777 during the installation, then re-set this to 770 after the install.
I have no idea why it is a problem during the joomla install...
Other than that it works fine with the latest php from atomic:

php -v
PHP 5.2.16 (cli) (built: Dec 19 2010 11:52:45)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with eAccelerator v0.9.6-svn358-dev, Copyright (c) 2004-2007 eAccelerator, by eAccelerator
with the ionCube PHP Loader v3.3.20, Copyright (c) 2002-2010, by ionCube Ltd., and
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

Re: PHP session problem on Plesk after update

Posted: Mon Dec 27, 2010 3:30 pm
by BruceLee
setting 777 on the directory is a bad idea since all other vhosts are possible to hijack sessions from someone else.
you should create a directory for the vhost with correct permissions and set this as session.save_path for the vhost.