开发者

IIS6: PHP Sessions

开发者 https://www.devze.com 2022-12-28 19:03 出处:网络
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:

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开发者_Go百科 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?


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.


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.


So the issue I had was that the performance of the server began to fail.. with errors like this for the session but the biggest issue that I saw was that mySQL was very slow..

Sessions failing to be created
Mysql performance poor

What I discovered was the WPI windows program installer was installing or updating my PHP version with each new website I was creating.. this was changing the php.ini file to point to the c:\windows\temp directory

Solution was to point the sessions and all PHP operations to a phptemp directory where PHP can work outside of windows\temp

Wish I knew this a week ago.

I tried to get into the windows\temp directory to delete some files but that was not happening.. that's my next issue to address.

0

精彩评论

暂无评论...
验证码 换一张
取 消