dudewad Posted June 4, 2009 Share Posted June 4, 2009 Hi, I'm pretty new with PHP, and I'm using vista with IIS 7.0, php 5.1 and MySQL. I'm just trying to get a php script to work, and it's pointed to be able to write session data in my C:/WINDOWS/Temp directory. I know this is simple, but I can't figure out how to allow access to it. When I run the script it exits and gives me: Warning: Unknown: open(C:\WINDOWS\Temp\sess_850474574d833eefdfe93eebb21dabba, O_RDWR) failed: Permission denied (13) in Unknown on line 0 So it's not allowed to write to the Temp directory... how do I let that happen? Thanks for any help!! Quote Link to comment https://forums.phpfreaks.com/topic/160876-allowing-php-to-write-to-cwindowstemp/ Share on other sites More sharing options...
corbin Posted June 14, 2009 Share Posted June 14, 2009 First off, make sure that folder exists. If so, then continue with the next stuff. You will need to give what ever user PHP is being ran as (probably the user under which IIS is running) read/write permissions to C:\Windows\Temp. To do it through the GUI, just navigate into the Windows folder, right click on the Temp folder, hit properties, go to the security tab, then I'm sure you can figure it out from there. To do it through the command line, you could do something like: (If it's an older OS, you would have to use cacls, not icacls. Note: they are not interchangeable!) icacls "C:\Windows\Temp" /T /grant "User PHP Runs As":RWMD That would grant read/write/modify/delete permissions to "User PHP Runs As" to C:\Windows\Temp and everything below it. Depending on the existing settings, you might also need to tweak inheritance settings though, so I would probably just go the GUI route. Quote Link to comment https://forums.phpfreaks.com/topic/160876-allowing-php-to-write-to-cwindowstemp/#findComment-855686 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.