Php – Problem with IIS 7.0 / PHP and new website in different physical location on hard drive (NOT WWWROOT)

iis-7PHP

First of all congrats to everyone who posts over here and contributes for a better environment … Anyways, lets boil it down to the problem.

Step 1 – I downloaded IIS 7.0 for windows 7 x64 and installed it. Everything is working fine and displaying the default website as expexted.

Step 2 – I then downloaded the PHP web Platform installer installed php …together with php manager 1.0. I then created a folder in default website ….. put an index.php in it with (phpinfo) converted this newly created folder to an application and it all showed up and worked a charm….

Step 3 – I then was developing a particular PHP application which requires saving of files onto the server and for some strange reason was unable to save…. thought it was all boiling down to folder permissions maybe… So I went through the permissions but the folder inherits permissions from inetpub… and am not changing that … therefore i went to the next step

Step 4 – I tried creating a new website in IIS (files located in different physical location on hard drive… read write permissions enabled – full control) but it did not show up (with the index.php in the folder) so this was funny so i did further testing…

Step 5 – Created a new website … did the usual settings (default app pool … inserted an alias .. and located the SAME APPLICATION i created earlier in the wwwroot to see if it shows up.. and it didn't …………………

Now I am quite short of ideas. It is weird how php applications within the wwwroot folder work fine but cannot seem to get saving operations to work in here… But it is just as weird that when i located the application which works through localhost does not work from the newly created website e.g. http://testmylocalphp.com (with physical path to the same app file above).

I really would appreciate your help on this. I would like to solve the saving issue … and hopefully create a phproot folder use it separate from the wwwroot and get it to show in the browser … in this manner I can put my php work in it and … I use wwwroot for asp.net ….

Your input on this subject is most welcome.

I send my best regards to everyone

Al

PS: I used to use IIS 6.0 but never ran into these problems …

Best Answer

There are 2 user accounts that may come into play. One is the app pool identity set on the app pool, and the other is the anonymous user account set on the website (I assume that you're using anonymous).

First off, on the website Authentication / Anonymous settings, set that to use the app pool identity. Then you only have 1 user to worry about.

For the app pool, you can set a custom user, or use IIS APPPOOL{app pool name}. That's the user that needs write permissions on disk. Also make sure that the PHP app isn't writing to a different folder than you expect ... one that doesn't have permissions.

For why PHP doesn't work under another site, do you get any error or status code? It may be the binding isn't correct.

Some great tools to help are: - process monitor from sysinternals.com. Pretty easy to learn and it's a quick download and free. Run it while you reproduce the issue. Then stop it so that it doesn't overwhelm you with data. Search for the word 'denied'. That should jump right to where your issue is. (use this for both the first site and second site issues) - IIS logs will tell what status code you get for the second issue issue. - Failed Request Tracing (FRT) can be set at the site level, and it will also tell you a lot. This will be more helpful on the second site issue.

Related Topic