• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Permission denied with session.save_path

_gmic_

New Pleskian
Hello,

I'm encountering an unusual problem regarding user permissions.

I have a site1 on a Plesk server, the session.save_path is the default one (/var/lib/php5, ower is root:root and permissions are drwx-wx-wt).
PHP is ran as an Apache module. The user Apache is www-data and it's in groups www-data, psaserv, psacln, psasb.

PHP sessions are working almost perfectly, but I have from time to time this kind of errors :
Code:
Unknown: open(/var/lib/php5/sess_kr5krp6eqov59fkd50a17ujhj1, O_RDWR) failed: Permission denied (13)

It's completly random, 95% of PHP sessions are OK, 5% return an error.

To investigate this problem, I've created a site2 with Plesk, and I've changed in the site settings the save_path option (like this solution : http://kb.odin.com/en/7056).
I have on this site2 a session.save_path set to /var/www/vhosts/site2.com/private/session
I've created this directory and set permissions to 0777, but I have the same error
Code:
Unknown: open(/var/www/vhosts/site2.com/private/session/sess_m8sv32uoaspjj3riparlnseiv2, O_RDWR) failed: Permission denied (13)

Code:
# ls -l
drwxrwxrwx 2 www-data www-data 4096 sept.  2 14:58 session

How could this directory not being writable as it have a 777 permission ?

I found many occurrences of this problem, but none of the solutions are solving my case.

Do you have any suggestions I can try ?

Thanks !
 
I think you have setup incorrect ownership for your session directory, Please try to setup correct ownership and check it


~# mkdir /var/www/vhosts/domain.tld/private/php_sess
~# chown <ftpuser>:psacln /var/www/vhosts/domain.tld/private/php_sess
~# chmod 0700 /var/www/vhosts/domain.tld/private/php_sess
 
Hello,

thank you for your answer.

I've deleted and then created the directory using the command you gave me :

Code:
ls -l /var/www/vhosts/site/private/
total 4
drwx------ 2 vincent psacln 4096 sept.  4 16:06 php_sess

Unfortunately it doesn't change anything :

Code:
[Thu Sep 04 16:16:33 2014] [error] [client X.X.X.X] PHP Warning:  Unknown: open(/var/www/vhosts/site/private/php_sess/sess_rmb2g5hke1cls2r5cm5ju8vq21, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[Thu Sep 04 16:16:33 2014] [error] [client X.X.X.X] PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/www/vhosts/site/private/php_sess)

Something to note, I have 2 directories for my site, /var/www/vhosts/site.tld/ and /var/www/vhosts/_.site.tld/, I don't know why... Anyway I've tried with both directories, same result.
 
Back
Top