How to resolve PHP session.save_path problem
It has taken me a whole morning and a lot of stress to fix this problem with my server’s PHP configuration, so I have documented here step-by-step exactly what I did in the hope that I can help others who are experiencing similar problems.
First of all, check your server settings to find out if this is your problem.
In Notepad, paste the following text and save it as an “all files” type called phpinfo.php:
<?php phpinfo(); ?>
Then use the FTP facility to upload this file to the root directory on your server. On mine this was the default location so I didn’t have to fiddle.
Once uploaded, point your browser to this file by typing in the address “www.yoursite.com/phpinfo.php” substituting yoursite.com with your own domain.
Scroll down to the “Session” section and look at the session.save_path. If it says “No value set” then you have the same problem I had and this is for you
Open a fresh page on Notepad and copy and paste into it the following text:
session.save_path = "/tmp"
Now In a new tab on your browser, log in to your hosting settings and find the details of your server, where your IP address, OS/Hosting type, PHP version, etc, are displayed. (On mine this is all together in one section). There you should see Absolute Hosting Path displayed beginning with /home/content……. Copy the /home/content….. string and toggle back to Notepad. Delete the /tmp bit by pasting in the /home/content…. string between the ” ” instead.
Save this Notepad document as an “all files” type with the name php5.ini then upload this via FTP to your root directory.
Point your browser once again at “www.yoursite.com/phpinfo.php” and check the session.save_path to make sure that this has worked. It should now be set to the value of your Absolute Hosting Path.
A bit more…
It may also be useful to note that this php5.ini file we have just created acts as an amendment to the master php.ini file, which can be viewed on your server by creating a Notepad file with the following text:
<? system("cat /web/conf/php5.ini"); ?>
Save this as an “all files” type called showme.php and upload it to your root directory, the same as you did with the phpinfo file. As before, use your browser to view this by typing in the address “www.yoursite.com/showme.php”