• 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

Problem session

JoseSPAIN

Basic Pleskian
Hello, I have found that when I try to log into a website that I have in my plesk server shows me this error:

Warning: Unknown: open (/ var/lib/php/session/sess_cat709qkqakrjf9u3367hi0l53, O_RDWR) failed: Permission denied (13) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify the current setting of That session.save_path is correct (/ var / lib / php / session) in Unknown on line 0

Do you know how to fix it?
 
Please see http://kb.parallels.com/en/7056 (although only Plesk 9 and 10 Plesk are mentioned, I think this applies to 11 as well)

We do see this issue happening on some systems. It is usually caused because the user that php runs as (same as ftp username) when using php_fascgi instead of mod_php does not have access to the default session storage directory (/var/lib/php/session).

*IF* this is the cause in your case, you can resolve it by following the KB. However, let me simplify it slightly:

1) Create a directory in the "private" directory that already exists within the domain's directory structure. e.g.
mkdir /var/www/vhosts/domain.tld/private/session

2) Chown the directory so that it belongs to the ftp username and psacln group. e.g. if the ftp username is yourftpuser then you'd do this:
chown yourftpuser.psacln /var/www/vhosts/domain.tld/private/session

3) Secure the directory a little bit
chmod 700 /var/www/vhosts/domain.tld/private/session

All the above is as outlined in Step 3 of the KB.

Next, change the php settings for the domain. You can do this via Websites & Domains tab -> Show advanced options -> Website Scripting and Security -> PHP settings tab.

Scroll down a bit and find session.save_path. Change from Default to Enter Custom value and then enter EITHER
{WEBSPACEROOT}/private/session
OR
/var/www/vhosts/domain.tld/private/session

Click on OK.
Examine /var/www/vhosts/domain.tld/etc/php.ini to confirm that your change has been written and that the path is correct.
You may need to restart apache but this should not be needed.

Try doing what you did before and see if the session errors have gone.

But please confirm that the cause of your issue is as outlined in the KB before continuing. It could be a permissions or ownership issue with your main sessions directory.

Note that the above has the safe effect as step 4 in the KB but is done in a different way. If one way doesn't work, try the other. Use phpinfo() to check what session save path is for the running site if you need to troubleshoot.
 
Back
Top