« Previous Next »

Thread: FastCGI, php & IIS on WinXP - file not found Virtual Directories issue

Last post 08-03-2009 8:53 AM by IT_Scooter. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 07-30-2009, 9:53 AM

    FastCGI, php & IIS on WinXP - file not found Virtual Directories issue

     I have a number of sites (virtual directories) set up in IIS5 on Win XP Pro (with SP3). Until I installed FastCGI, they all worked fine - no problems. Now, as long as I don't request a .php page, they work fine, if I request a .php page, I get a HTTP 404 - file not found error.

    After trying Process Monitor, I discovered that the .php pages start in the correct directory as specified in IIS, but end up in the default directory (C:/inetpub/wwwroot/<sitename>).

     What needs to happen to make FastCGI behave? (If I move my site to a folder in the default directory, it all works fine, but that's not what I want to do

    Any ideas?

  • 08-03-2009, 3:11 AM In reply to

    Re: FastCGI, php & IIS on WinXP - file not found Virtual Directories issue

    Hi,

    Could you create and request  a phpinfo.php page in your site that contains "<?php phpinfo(); ?>" to test ?

     If you still encounter error, please send the full error message. Make sure the Show friendly HTTP error message is disabled.

    If the phpinfo.php page works well ,then you should check the PHP code. This issue is probably caused by the relative path or SERVER["DOCUMENT_ROOT"] variable in the page.

    Leo Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • 08-03-2009, 3:56 AM In reply to

    Re: FastCGI, php & IIS on WinXP - file not found Virtual Directories issue

    Hi,

    Try commenting out the doc_root value in your php.ini file. It sounds like all your PHP applications are inheriting this value. This is a well-documented 'gotcha' with PHP on IIS :

    http://www.iisadmin.co.uk/?p=4#comment-113

    http://bugs.php.net/bug.php?id=48776

    Regards,

    Paul Lynch | www.iisadmin.co.uk
  • 08-03-2009, 8:36 AM In reply to

    Re: FastCGI, php & IIS on WinXP - file not found Virtual Directories issue

    Leo Tang - MSFT:

    Hi,

    Could you create and request  a phpinfo.php page in your site that contains "<?php phpinfo(); ?>" to test ?

     If you still encounter error, please send the full error message. Make sure the Show friendly HTTP error message is disabled.

    If the phpinfo.php page works well ,then you should check the PHP code. This issue is probably caused by the relative path or SERVER["DOCUMENT_ROOT"] variable in the page.

     

     

    Hi Leo Tang,

    Thanks for your reply. Show friendly error message is disabled.

    phpinfo.php from C:/inetpup/wwwroot is ok, if I put it [phpinfo.php] into the directory for the website I'm having problems with, it doesn't work. I get "No input file specified." in Firefox & IE8.


    Also, there is no SERVER["DOCUMENT_ROOT"] variable anywhere in the php pages for the site.

     Regards,

     Paul

  • 08-03-2009, 8:53 AM In reply to

    Re: FastCGI, php & IIS on WinXP - file not found Virtual Directories issue

    Paul Lynch:

    Hi,

    Try commenting out the doc_root value in your php.ini file. It sounds like all your PHP applications are inheriting this value. This is a well-documented 'gotcha' with PHP on IIS :

    http://www.iisadmin.co.uk/?p=4#comment-113

    http://bugs.php.net/bug.php?id=48776

    Regards,

    Hi Paul,

    Thanks for your reply.

    The doc_root is already commented out - in php.ini, but FastCGI doesn't use that .ini - it uses php-cgi-fcgi.ini - commented it out in php-cgi-fcgi.ini & now it works.

     Thanks again,

    Paul

Page 1 of 1 (5 items)
Microsoft Communities