Connecting Tech Pros Worldwide Forums | Help | Site Map

PHP IIS6 and Virtual Directory problems

Newbie
 
Join Date: Apr 2006
Posts: 1
#1: Apr 25 '06
Hi
Just thought I'd post this as I've been searching for a solution to this for ages and found nothing!!

The Problem:
Windows Server 2003, PHP 5 and IIS6

PHP works fine in the default webserver wwwroot (and all subfolders)
BUT it doesn't work in any virtual directory - gives a 404

The virtual directories are set up fine, since any *.html file will open (so its not a permissions thing)
BUT any php file (including phpinfo.php) will not run, returning a 404 file not found error

The solution:
in php.ini the doc_root needs to be set to nothing (ie blank)

Easy when you know how
:)

Newbie
 
Join Date: Jul 2006
Posts: 1
#2: Jul 31 '06

re: PHP IIS6 and Virtual Directory problems


Quote:

Originally Posted by lidnia

Hi
Just thought I'd post this as I've been searching for a solution to this for ages and found nothing!!

The Problem:
Windows Server 2003, PHP 5 and IIS6

PHP works fine in the default webserver wwwroot (and all subfolders)
BUT it doesn't work in any virtual directory - gives a 404

The virtual directories are set up fine, since any *.html file will open (so its not a permissions thing)
BUT any php file (including phpinfo.php) will not run, returning a 404 file not found error

The solution:
in php.ini the doc_root needs to be set to nothing (ie blank)

Easy when you know how
:)

Thank you. After countless hours of Google searches and reinstalling this and that, this finally solved my problem.
Newbie
 
Join Date: Nov 2006
Posts: 1
#3: Nov 23 '06

re: PHP IIS6 and Virtual Directory problems


Thanks also for the solution since none of the general instructions mention it and I wasted a lot of time trying to puzzle out why it didn't work. The solution also works with IIS5.1 Remember when testing that .htm files with PHP commands will not execute their PHP code; the file extension must be .php
Newbie
 
Join Date: Feb 2008
Posts: 1
#4: Feb 19 '08

re: PHP IIS6 and Virtual Directory problems


You're a saint. Such a simple thing but it was driving me crazy.

Needless to say it worked. Blanked the setting and rebooted. Poof!
Newbie
 
Join Date: Jul 2008
Posts: 1
#5: Jul 21 '08

re: PHP IIS6 and Virtual Directory problems


Thank you! This really works. In my case I had to restart the computer first to see the changes..now it works!
Reply