PHP5 on IIS (Win2k)



  • I have PHP installed on a Windows 2k Server running IIS. The extension is configured properly in the settings for the virtual web server, pointing to the CGI binary (C:/PHP/php-cgi.exe), and the IUSR account has access to both the PHP folder and the document root. However, when I try to open a PHP page, the page throws a "CGI Timeout" error. ISAPI is no better -- it just loads a blank page.

    Anyone have a clue why it's doing this?

     
    Regards,
    Brad Williams
    Northeast Metrology Corp.
     



  • Do you have URLScan installed and loaded on the server?  If memory serves, its part of the IISLockdown addon for IIS5 and may have been part of a service pack.  If so, there is a config file that might be blocking php extensions - I think it is %WIN_DIR%\UrlScan.ini.



  • No, that isn't it... no such file is in my WINDIR. I repeated the instructions for installing it as an ISAPI module, and once I set the ISAPI filter in the settings, everything goes to hell. The inetmgr crashes out, and when I reboot, none of the IIS services start... they don't fail to load, they just try to start no matter how long I leave it (was about an hour, then reboot, and now about another hour).

     Any ideas?

    Regards,
    Brad Williams
    Northeast Metrology Corp.
     



  • I haven't worked with PHP in years (thank God), so I'm a little rusty.  My next guess is that you've got a misconfigured extension in your php.ini.  I'd comment all the extension lines in the php.ini and see if you can get a simple script to run <?php echo "Hello World"; ?> from the command line (c:\php\php-cgi.exe myscript.php).  Once you get the simple script working from the command line, you can try it again on IIS and it should work.

    Then you can go back and enable just the extensions you need and test the real scripts.




  • Off the top of my head, I would also suggest you go through your php.ini file. In particular, look for doc_root and set it to the path of your www root folder. Example:

    doc_root = "c:\inetpub\wwwroot\"

    Then scroll down an read about cgi.force_redirect



  • Will report later, but my problems might not be software... the server started throwing up STOP errors, and a Memtest showed something along the lines of 600 errors and 49000 ECC errors, so that might have been the problem with the crashing... dunno.

    Regards,
    Brad Williams
    Northeast Metrology Corp.

     



  • @R.Flowers said:

    Off the top of my head, I would also suggest you go through your php.ini file. In particular, look for doc_root and set it to the path of your www root folder. Example:

    doc_root = "c:\inetpub\wwwroot\"

    Then scroll down an read about cgi.force_redirect

    For reasons I don't pretend to understand, cgi.force_redirect is a no-no on IIS, according to the comments in the default php.ini. They also suggest doc_root is unnecessary as well.


Log in to reply