Search for:

Available article translations:

PHP on domain running via CGI/FastCGI can't use session by default

Article ID: 7056, created on Dec 25, 2009, last review on Sep 5, 2014

  • Plesk 12.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 10.4 for Linux/Unix

This issue has been completely fixed since Plesk 10.4. In case if you upgrade to 11.x or 12 versions, please ignore this warning. It occurs in case if permissions on the '/var/lib/php/session/' directory are set incorrectly Upgrade in fact fixes the permissions


In CGI or FastCGI mode, PHP runs with the permissions of the domain's FTP user.

PHP support mode can be configured for each domain on the "Web Hosting Settings" page found at Domains -> domain.tld -> Web Hosting Settings:

Also following PHP warnings can appears:

**Warning**: session\_start() [function.session-start]: open(/var/lib/php/session/sess\_vr12g68afa365jenb96han4k24, O\_RDWR) failed: Permission denied (13) in **/var/www/vhosts/<domain>/httpdocs/<script>.php** on line **<N>****Warning**: Unknown: open(/var/lib/php/session/sess\_vr12g68afa365jenb96han4k24, O\_RDWR) failed: Permission denied (13) in **Unknown** on line 
**Warning**: Unknown: Failed to write session data (files). Please verify that the current setting of\_path is correct (/var/lib/php/session) in **Unknown** on line


In Parallels Plesk Panel versions prior to 10.4, PHP configuration is set in the /etc/php.ini file and by default has the session path set as follows::
  ~# grep\_path  /etc/php.ini\_path = "/var/lib/php/session"

The default permissions value for this directory is 770:

~# ls -ld /var/lib/php/session
drwxrwx--- 2 root apache 65536 Dec 16 07:48 /var/lib/php/session


As the PHP scripts are processed in CGI/FastCGI mode under the <ftpuser>:psacln account, the process cannot read/write that directory and it will, effectively, pick up the session file.


1. Upgrade Parallels Plesk Panel to version 10.4.

2. Set up customized PHP configuration for the domain.

3. Create a subdirectory under the domain's private directory:

~# mkdir /var/www/vhosts/domain.tld/private/php\_sess
~# chown &lt;ftpuser&gt;:psacln /var/www/vhosts/domain.tld/private/php\_sess
~# chmod 0700 /var/www/vhosts/domain.tld/private/php\_sess

4. Edit the customized PHP configuration file php.ini and overwrite the session.save_path directive as shown below:

~# grep\_path  /var/www/vhosts/domain.tld/etc/php.ini\_path = "/var/www/vhosts/domain.tld/private/php\_sess"

a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 dd0611b6086474193d9bf78e2b293040 56797cefb1efc9130f7c48a7d1db0f0c 2a5151f57629129e26ff206d171fbb5f e335d9adf7edffca6a8af8039031a4c7 e8756e9388aeca36710ac39e739b2b37 01bc4c8cf5b7f01f815a7ada004154a2 0a53c5a9ca65a74d37ef5c5eaeb55d7f

Was this article helpful?
Tell us how we may improve it.
Yes No
Server Virtualization
- Odin Cloud Server
- Odin Containers for Windows 6.0
- Odin Virtuozzo Containers
- Odin Automation
- Odin Automation for Cloud Infrastructure
- Odin Business Automation Standard
- Odin Virtual Automation
- Odin Plesk Panel Suite
- Web Presence Builder
- Odin Plesk Automation
- Odin Small Business Panel
- Value-added Services for Hosters
- Odin Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification