Search This Blog

Wednesday, 11 April 2012

Fix Session Save Path Unwritable error in PHP

 Depending on the web hosting service you used, there are several possible solutions as listed below.

Define session.save_path directive in PHP.INI
If you have root access or control to the web host (for example, in VPS or dedicated server), edit the PHP.INI PHP configuration file in the web server to add in the environment variable. Normally the session.save_path directive is already included in the default PHP.INI, but been commented out. Add or edit the line so that it looks like below:
session.save_path = /tmp

Include session.save_path in .htaccess file
If you can’t modify PHP.INI global configuration file, or just want to make the change affect Joomla! or Mambo application only, create or edit the .htaccess file in the installation directory for Joomla! or Mambo, and add the following line (only works in Apache web server which configured to support .htaccess – most cPanel hosts do):
php_value session.save_path '/tmp'

Include in PHP file 
If nothing mentioned above you can do, then try to edit globals.php file comes with Joomla. Firstly create a writable folder, and then edit the globals.php in root Joomla! directory. Add in the following line at the top, right after <?php line:
ini_set('session.save_path','/tmp');


No comments:

Post a Comment