views:

132

answers:

2
+3  Q: 

IIS6: PHP Sessions

I have installed PHP to work with IIS6 (with FastCGI). I am capable of viewing a sample test website that shows the PHP info with the following code: <?php phpinfo(); ?>

Now that this works I tried to migrate my PHP website to IIS6 and here is a list of the errors/warnings I got:

PHP Warning:  session_start(): open(C:\WINDOWS\Temp\sess_rjbv0ialf7uf03to69q1e4l101, O_RDWR) failed: Permission denied (13) in C:\Site\index.php on line 11

PHP Warning:  Unknown: open(C:\WINDOWS\Temp\sess_rjbv0ialf7uf03to69q1e4l101, O_RDWR) failed: Permission denied (13) in Unknown on line 0

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

After seeing this, I corrected the php.ini file to set correctly the session save value:

session.save_path="C:\WINDOWS\Temp"

Yet doing so has done nothing! How can I make it work?

Any suggestion is really appreciated!

+3  A: 

Does the account that IIS is running under (IUSER_INETPUB or whatever it is) have write permissions on C:\Windows\Temp? It may either not have permission to access anything in C:\Windows, or be explicitly denied any rights. You may want to create another directory elsewhere (C:\PHPSessions, maybe) and explicitly grant read/write (but NOT execute) permissions to the IIS account on that directory.

Marc B
A: 

After upgrading a Windows XP development machine PHP 5.2.13.13 to 5.2.14.14, I got the same problem.

It was necessary to grant the IWAN_ account write access to any files/folders being updated by PHP e.g. c:\windows\temp, C:\Inetpub\wwwroot\\cache etc

I guess they changed the way PHP uses worker processes.

Jules