Klovera.comBlog
Follow Us:

Joomla Session Save Path

Dustin  |  Content Management Systems  |  April 8th 2008

If you are looking at this post you have probably seen the following error when trying to install Joomla 1.0.x:

Warning: is_writable() [function.is-writable]: open_basedir restriction in effect. File(/var/lib/php/session) is not within the allowed path(s):(/var/www/vhosts/yourdomain.com/httpdocs:/tmp) in /var/www/vhosts/yourdomain.com/httpdocs/installation/index.php on line 154

The solution to this is two-fold:

Note: I am running CentOS with PLESK on a VPS for this example, but the principles should apply for other configurations as well.

1) You must change the location of the session save path.

While you could simply turn off open_basedir in your php.ini file I like to have this enabled since it is more secure. To change the location of the session save path add a new writable directory above your public http folders and make it writable (707 for my purposes). I named mine ‘session’. Next add the following line to your .htaccess file

php_value session.save_path  '/var/www/vhosts/yourdomain.com/session'

2) You must change the basedir for your account

Open /var/www/vhosts/yourdomain.com/conf/httpd.include

Do a search for open_basedir and dhange all occurrences of

/var/www/vhosts/yourdomain.com/httpdocs:/tmp

to

/var/www/vhosts/yourdomain.com:/tmp 

Disclaimer: Note that this will not work on all hosts – especially some shared hosts. I am interested if anyone has a better solution or if they see any security issues with this method.

4 Responses to “Joomla Session Save Path”

  1. Sandi says:

    I am using Apache and Virtuozzo on Plesk 8.3.0.
    My problem was very similar: The Joomla! installer pre-installation check screen displayed “Unwritable” in red for the session save path parameter.

    I did everything Dustin said above. But it still did not work. I tried about 20 other things, nothing worked. Finally, I found somewhere that you should re-start the Apache Web Server Service. I did that, and voila’!

  2. Dustin says:

    Sandi is correct. Anytime you change your php.ini settings you must restart apache for the settings to take effect. How this is actually done can vary – on the servers I use you type ‘service httpd restart’ at the command line.

  3. Increase Search Engine Ranking says:

    Should be:
    /var/www/vhosts/yourdomain.com/conf/vhost.conf
    Not:
    /var/www/vhosts/yourdomain.com/conf/httpd.include

    The http.include should not be touched. Instead, put what you want in vhost.conf.

Leave a Reply

Klovera is a forward thinking, full service digital agency whose purpose is to bring value to our client's businesses through creativity, strategy, metrics, user experience and technology.