Using:
Windows 2003 Standard Edition
IIS
PHP 5.2.5.5
I cannot access a php file when I try to hit it in my web browser ( IE or Firefox ). I can access a gif file though. I enter the web site using the internal ip to access the files. I also set up a virtual directory. The same thing applies here. I can access the gif file I put into the folder for the virtual directory, but I cannot access php files that are in the virtual directory.
So, it appears that IIS is working since I can hit the gif file in a web browser. The problem is that I cannot hit a php page in any web browser from any virtual directory.
I set the permissions on the folder for the virtual directory by adding 'Everyone' and allowing. ( This is not a system that will be accessed from the outside world, so security is not an issue. )
Earlier in the day, I had a an older version of all of the files in the virtual directory folder. I was able to access these files in the browser. Everything was working correctly. I could access php files from the virtual directory also. The problem only showed up after I started applying the new files / folders.
Then, I renamed the old folder by attaching '_old' to the end of the folder name. I named the new folder, with the newer version of the files, the same name as the original folder for the virtual directory. So, the new folder has the same name as the old folder did. As far as I know, IIS should not be able to tell the difference. It should still be looking for the same folder and find it since the new folder has the same name.
But, just in case IIS could tell, I removed the virtual directory and added it back in. This would be the virtual directory with the new folder that contains the new version of the files. I made sure the .php extension was still there and it was. ( Right click on virtual directory named 'george', choose properties, click on configuration, then I see 'php' in the 'Application Configuration' box. )
Also, when viewing the IIS Manager, I clicked on the 'Web Service Extensions' folder. On the right, php is listed as as a Web Service Extension and it is 'Allowed'.
I checked the IIS logs and found this when I tried to access a php page in the virtual directory 'george':
2009-12-12 14:24:05 W3SVC1 192.168.2.46 GET /george/login.php - 80 - 192.168.1.51 Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US;+rv:1.9.1.5)+Gecko/20091102+Firefox/3.5.5+(.NET+CLR+3.5.30729) 302 0 0
But, as you can see, I can hit a page with the file extension .gif from within the virtual directory 'george':
2009-12-12 13:16:02 W3SVC1 192.168.2.46 GET /george/1click.gif - 80 - 192.168.1.51 Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US;+rv:1.9.1.5)+Gecko/20091102+Firefox/3.5.5+(.NET+CLR+3.5.30729) 200 0 0
I also cannot access a php file from the root virtual directory:
2009-12-12 14:03:05 W3SVC1 192.168.2.46 GET /test.php - 80 - 192.168.1.51 Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US;+rv:1.9.1.5)+Gecko/20091102+Firefox/3.5.5+(.NET+CLR+3.5.30729) 404 3 50
I can access the gif file in the virtual directory:
2009-12-12 13:16:02 W3SVC1 192.168.2.46 GET /george/1click.gif - 80 - 192.168.1.51 Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US;+rv:1.9.1.5)+Gecko/20091102+Firefox/3.5.5+(.NET+CLR+3.5.30729) 200 0 0
Any ideas? I think I need to fix something with php, but I do not know what.
Cannot access php page in browser using IIS, can access gif
Moderator: General Moderators
-
toolmania1
- Forum Newbie
- Posts: 1
- Joined: Sat Dec 12, 2009 8:38 am