I got PHPINFO(); to work. Now I am trying to get an html file to work. Ideas?
IIS ansd PHP 8
Hi;
I am trying to get php and iis to work. In found some instructions and followed them to the letter.
when I test iis and php I get a 404. Why doesn't it work? Help please.
Windows for business | Windows Server | Devices and deployment | Other
2 answers
Sort by: Most helpful
-
-
Harry Phan 8,730 Reputation points Independent Advisor
2025-10-05T01:06:28.9933333+00:00 Getting
phpinfo()working—that's a huge first step and tells us that PHP itself is installed correctly and processing through IIS. The fact you're getting a 404 specifically on the HTML file narrows the problem down significantly, as it's a different issue from a PHP processing error.A 404 error means the web server (IIS) received the request, but couldn't find the file you're asking for in the location it's expecting. Since PHP files work, the issue is almost certainly with the specific path to your HTML file or the default document configuration.
Let's check a couple of things:
First, could you confirm the exact physical location of your HTML file on the server's hard drive? It needs to be in the directory that your IIS website or application is pointing to as its "physical path." A common mistake is putting the file in a different folder than the one IIS is serving content from.
Secondly, let's look at the "Default Document" settings in IIS Manager. If your HTML file isn't named something common like
index.htmlordefault.html, IIS won't serve it automatically when you just browse to the directory. You might need to either rename your file to one of these common names or add its exact filename to the list of default documents for that site.Also, could you tell me the full path where you've placed your HTML file and what you've named it? With that info, we can pinpoint exactly where the disconnect is happening.
=====
You're very close to getting this working! If this guidance helps you solve the 404, please feel free to mark the answer as accepted—it's always nice to see a problem get resolved 😊.