Support / KnowledgeBase

 
Search the KnowledgeBase Search

(dv) Session save path errors and the vhost.conf

  • Applies to: (dv) 3.5, (dv) 4.0

  • Difficulty: Easy

  • Time needed: 10 minutes

  • Tools needed: SSH, root access, vi knowledge

 
  • Applies to: (dv) 4.0
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: SSH, root access, vi knowledge
  • Applies to: (dv) 3.5
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: SSH, root access, vi knowledge

Overview

Session support in PHP is of a way to preserve certain data across subsequent accesses. This enables you to build more customized applications for your web site.

The /var/lib/php/session/ directory should be writable by default.

End of Life Warning

This service has a pending End of Life. Please move to a current service as soon as possible. For more information, please see: (dv) Dedicated-Virtual 4.0: Migration Information.

READ ME FIRST

This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.

Instructions

The default configuration on (dv) Dedicated-Virtual Servers does not allow for this if you are running PHP as a specific user (using FCGI, for example). To fix this, run the following command:


chmod 1777 /var/lib/php/session

It is also possible to fix this on a domain-by-domain basis using a special file called vhost.conf:

  1. Create the new directory to house your sessions inside of your domain directory:
    
    mkdir /var/www/vhosts/example.com/tmp
    

    NOTE:

    Replace example.com with your domain name. If this is an additional domain on the same subscription, replace example.com for the root directory for the additional domain. The default directory for an additional domain on the same subscription is site1, see Figure 1 below.


    Figure 1.

  2. Apply the appropriate permissions and file ownership:
    
    chown username:psaserv /var/www/vhosts/example.com/tmp && chmod 777 /var/www/vhosts/example.com/tmp
    
  3. Create the vhost.conf file in the following directory /var/www/vhosts/example.com/conf using the following command:
    
    vi /var/www/vhosts/example.com/conf/vhost.conf
    
  4. Next, include the following line:
    
    php_value session.save_path /var/www/vhosts/example.com/tmp
    
  5. Save the file and run this command to force Plesk to see the changes:
    
    /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=example.com
    
  6. Restart Apache to load the new changes:
    
    service httpd graceful
    
  7. Your software should now use the new path for sessions data and your CMS installation should proceed.

Resources


User Comments

No visitor comments posted. Post a comment
Fields marked with an asterisk(*) are required. Comment on this article
Fill out the form below if you would like to comment on this article.
 
 
 

(code is not case-sensitive)
 
Submit
 
 

Continue