PHP session problem on Plesk after update

Community support for Plesk, CPanel, WebMin and others with insight from two of the founders of Plesk. Ask for help here! No question is too simple or complicated. :-)
Endimmion
Forum User
Forum User
Posts: 5
Joined: Sun Dec 26, 2010 1:53 pm

PHP session problem on Plesk after update

Unread post 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?
mneese77
Forum Regular
Forum Regular
Posts: 137
Joined: Wed May 12, 2010 5:40 pm

Re: PHP session problem on Plesk after update

Unread post 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?
Endimmion
Forum User
Forum User
Posts: 5
Joined: Sun Dec 26, 2010 1:53 pm

Re: PHP session problem on Plesk after update

Unread post 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
Endimmion
Forum User
Forum User
Posts: 5
Joined: Sun Dec 26, 2010 1:53 pm

Re: PHP session problem on Plesk after update

Unread post by Endimmion »

but are you using Plesk and FastCGI too?
mneese77
Forum Regular
Forum Regular
Posts: 137
Joined: Wed May 12, 2010 5:40 pm

Re: PHP session problem on Plesk after update

Unread post 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
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: PHP session problem on Plesk after update

Unread post 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.
Post Reply