1
votes

Hey guys i am using a Windows 2016 VPS Server and i installed IIS Web server on it along with php but i am getting this error with sessions.

Warning: session_start(): open(C:\Windows\temp\sess_qbageacapafd73fbj19idjbtd3, O_RDWR) failed: Permission denied (13) in C:\inetpub\wwwroot\system\global.php on line 6

I got the same error when i choose a different session path

Warning: session_start(): open(C:\Windows\PHPSessions\sess_qbageacapafd73fbj19idjbtd3, O_RDWR) failed: No such file or directory (2) in C:\inetpub\wwwroot\system\global.php on line 6

Is there a way to fix this?

1
thank you for cleaning my question - Virtuoso NoShow
Sounds like in the first error, the user your IIS server runs Apache as doesn't have access to the temp folder. In the second one, the PHPSessions folder doesn't exist. - Jeremy Harris
Is there anyway to give access to temp folder - Virtuoso NoShow
thanks the post really helped me. - Virtuoso NoShow

1 Answers

0
votes

You need to update the permissions of the temp folder so the user that IIS runs as has write permissions.

Another option is to change the session folder to a folder that is inside your document root. This is not recommended on public websites for security reasons since it can allow hackers to access your session information.

The best option is to give write permission to the IUSER or whatever user IIS runs under