0

I cannot figure out why my PHP installation is requesting a physical path without an extension.

Requested URL http://localhost:80/index

Physical Path C:\inetpub\wwwroot\index

Error message

PHP is working fine with phpinfo.

web.config contents (although the error is unchanged regardless of whether the web.config file exists in the root folder or not): https://pastebin.com/5E2x3yeP

I have tried Googling and to my surprise no results related to a physical path showing no extension. I'm sure I'm missing something silly in the php.ini or something. Any help is extremely appreciated!

2
  • Who wrote the rules in web.config? None of them would redirect localhost:80:index to localhost:80/index.php, and that's exactly why IIS checks and responds 404.
    – Lex Li
    Apr 16, 2018 at 19:26
  • The issue was unrelated to the web.config file and was fixed by re-installing IIS.
    – Terrum
    Apr 20, 2018 at 18:54

2 Answers 2

0

If you request an URL, a web server does the following:

  • sees if a file name matching the URL exists. If yes, it will sent it to the client.
  • otherwise, checks if a directory with this name exists. If it does, the following will happen:
    • If there is a file in that directory that the server considers as an index file, it will show this (that's the usual index.html case).
    • It this doesn't exist but the server is configured to show the contents of the directory, it will list all file names.
    • If neither is the case, an error will be shown.
  • If neither a filename nor a directory exists with the same name, there also will be an error (404).

So, in your case, everything works as expected, as you just requested the name index, which apparently doesn't exist.

1
  • I appreciate that information. The CMS is coded to automatically redirect index.php to index. I have edited the original question with the web.config contents. Although the issue still occurs regardless of whether the web.config file exists or not. I think the issue lies in the PHP or IIS configuration where it is not retrieving the correct physical file, as it shows no extension for some reason.
    – Terrum
    Mar 26, 2018 at 17:39
0
  1. Go to Internet Information Services (IIS)
  2. Click on "PHP Manager"
  3. Click on "Register new PHP version"
  4. Locate the php(usually,C:/Program Files(86)/php-version)
  5. Choose php.exe or php-cgi.exe

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .