A while ago I was working on an PHP project and decided to give the new WebMatrix a try because it has PHP support. The installation with the web platform tool is painless. When I opened the PHP project, WebMatrix noticed that I did not had PHP installed and it was installed automatically. awesome! When I downloaded, installed and configured MYSQL on my Windows 8 machine it was all good to go. Only the existing code did not work. It took me a while to realize that my MYSQL connection was working fine. After a while I figured out that the session variable was not filled.
A small phpinfo file with the famous
<?php phpinfo(); ?>
Told me that the error_log was located at C:\WINDOWS\temp\php53_errors.log and that file told me
[21-May-2013 17:39:40 Asia/Kuwait] PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\WINDOWS\temp) in Unknown on line 0
So I tried to open the path manually and it required Administrator rights.
To fix this I had to change session.save_path to an other directory.
So you have to open the php.ini file. Mine was located in the folder C:\Program Files (x86)\IIS Express\PHP\v5.3\
and search for a line which isn’t commented out and has the session.save_path=C:\windows\temp and replace it with a writeable path.
Happy programming with WebMatrix 3!