Configuration Information:

  O/S:  Windows XP Professional (NT 5.1 Build 2600)
  O/S Path:  PATH=C:\WINDOWS\system32;C:\WINDOWS;...C:\PHP
  php Version:  5.0.1
  Configuration file path:  C:\WINDOWS\php.ini
  php doc_root:  C:\inetpub
  Web Server:  IIS version 5.1
  IIS Home Directory:  c:\inetpub
  IIS Configuration for ISAPI Applications:
      -- .php C:\php\php5isapi.dll
      -- .phtml C:\php\php5isapi.dll

Known Facts:

  1.  This runs as expected from the command line when in any directory
on the system:  php -f test.php.  The test.php file contains this code:

    <?php
    phpinfo();
    ?>

    And the result is the phpinfo() result scrolling along to the end in
the command window.

  2.  This HTML code runs as expected in a file named "index.phtml" that
is located in the c:\inetpub directory:

    <!doctype html public "-//W3C//DTD HTML 4.0 //EN">
    <html>
    <head>
            <title>php test</title>
    </head>
    <body>
    <?php
    phpinfo();
    ?>
    </body>
    </html>

  3.  This system worked as expected using a CGI configuration and php
version 4.  I moved to php 5 AND the use of ISAPI yesterday and started
the following issues.

Issues:

  1.  That same HTML code will not execute via php in a file named
"index.html" that is in the same directory as the "index.phtml" file.
Instead the result I get is a blank page and when the source is viewed
it contains all of the above code, which indicates that php is not used
by the server when that file is served.

  2.  The IIS server is configured to use a virtual directory with this
path:  C:\inetpub\wwwroot\pclcrg.  Only files that are placed in that
directory and that have the extension .phtml or .php run as expected,
BUT ONLY IF THE FULL PATH IS USED in the URL.  For example:

  http://localhost/wwwroot/pclcrg/index.html -- does not work and gives
the same results as the "index.html" file described in issue "1" above.

  http://localhost/pclcrg/index.html -- works exactly like the first
example -- URL does not matter.

  http://localhost/pclcrg/index.phtml -- does not work and gives a 404
error.

  http://localhost/wwwroot/pclcrg/index.phtml -- works as expected --
URL matters.

Questions:

  1.  Why is the server giving that 404 error for a file that exists in
the virtual directory, yet serving it out as expected when a "full path"
is given in the URL?

  2.  Is there a way to configure IIS to handle the problem in question
1 as expected?

  3.  Most important, how can I get IIS to handle php code in a file
that is NOT listed in the ISAPI configuration.  For example, how can I
get IIS to run php code that is contained in an HTML file that has an
extension of ".htm" or ".html"?

Thanks in advance for any help you can provide,

Brad Bates
Systems Librarian
Polk County Library Cooperative
[EMAIL PROTECTED]

Reply via email to