Partner and Community Forums
PHP Scripts won't execute in subfolders
Last post Nov 12, 2013 09:41 AM by zerogue
Apr 25, 2008 06:41 PM|Mark.Martin|LINK
IIS newbie here...I'm sure this is just a simple configuration issue, but I can't figure out what I need to do.
I've got a .PHP site that I'm trying to bring up on IIS 6. I can get scripts to run in my root folder, but when I try to run a script out of any subfolders I get a "Website cannot display page" message.
www.mysite.com/index.php works but
www.mysite.com/subfolder/index.php doesn't work.
What do I need to do to allow scripts to run in a subfolder?
Thanks in advance.
Apr 28, 2008 12:04 PM|brashquido|LINK
Sounds like a ScriptMap issue. I wrote an article on
working with IIS 6 ScriptMap inheritance which might be of some assistance to you. If not, post back and we can take it from there.
Apr 28, 2008 07:13 PM|Mark.Martin|LINK
Apr 28, 2008 09:06 PM|brashquido|LINK
Double check your NTFS permissions. Make sure your IUSR_MACHINENAME account has read permissions to all your PHP files and directories.
Apr 28, 2008 10:00 PM|Mark.Martin|LINK
Read & Execute are set at the root level and inherited by all sub directories.
Apr 29, 2008 09:36 AM|brashquido|LINK
Ok, lets try and get back to some basics. Could you turn off friendly HTTP errors in IE (Internet options -> Advanced) and then post back the specific error code number when trying to access PHP files in your sub directories. Also, could you try using a
simple phpinfo page in your subfolders to see if PHP is working at all. Just enter the following code in a file and call it phpinfo.php or similar (so long as the extension is .php);
Apr 29, 2008 08:43 PM|Mark.Martin|LINK
Thanks, that helped. PHP was erroring out and IE was reporting "Page not found". By disabling IE's "friendly HTTP errors' I was able to see the error message and make the necessary corrections.
May 25, 2008 01:26 PM|DanGold|LINK
nice variant xD
Jun 08, 2008 09:02 AM|klever76|LINK
Did the 404 error contain a substatus code. Because if this is IIS 6 there could be several reasons for getting this error among them being that a file truly does not exist but i'm sure you have checked that. If you have added the script map should also
make sure that the PHP executable is allowed in the Web Service Extensions Section.
web service extensions
Dec 18, 2008 07:22 PM|willow315|LINK
I am having the same issue with a second Website I just created in IIS. the PHP test/info page works in the root, but when I test the same file in the sub-folder, I get either a 404 or No input file specified, which ie same thing. I've turned off friendly
HTTP errors, and that's what I get.
I have checked the mapings and appropriate extensions are added at the Websites level. Also permissions are set for all subfolders. they are OK.
I'm unclear about what this person did to actualy resolve the issue. Can you assist?
Jan 19, 2009 11:43 AM|best_links|LINK
i was also facing the same problem but it has been solved out really thanks alot.
Nov 12, 2013 09:41 AM|zerogue|LINK
Its very annoying people say their problems were resolved but not sharing the solution with you.
I just resolved the problem and I am not going to tell you either!
Nah I am joking.
Check the entry "doc_root" in your PHP.ini file. Make sure its commented out if it's pointing to something like "c:\inetpub\wwwroot".
Save the file, restart IIS then your problem is resovled.