How to solve the 404 error when building a PHP website with IIS?
When building a PHP website using IIS, a 404 error message appears. I believe it is a problem that no one wants to see. Fortunately, this problem is not too difficult to deal with. It is mainly a configuration issue. . Today, the editor will share with you how to deal with the 404 error prompt when using IIS to build a PHP website. I hope it will help all users.
1. Visit other pages in the website directory, such as html and asp pages, to see if they are normal. If it is abnormal, it means that the configuration of the website's home directory is incorrect, and then the problem will be much simpler to solve.
2. If the configuration of the website’s home directory is incorrect, you need to manually configure IIS.
1. Select Start Menu->Programs->Administrative Tools-> Internet Information Services (IIS) Manager, and then click [Web Service Extension] to see if the PHP extension is allowed to run. If it says no, then it says how it's not running, just run it.
If you don’t even see the PHP extension, it means that the IIS environment has not added the PHP extension. In this case, you need to manually add the PHP extension service. The specific operation method is as follows:
Select Start Menu->Programs->Administrative Tools-> Internet Information Services (IIS) Manager, and then click [Add a new one] in [Web Service Extension] Web service extension].
The [New Web Service Extension] window will appear. Enter [PHP] in [Extension], then click the [Add] button inside to add [C:PHPPHP5isapi.dll] to it. Finally, check [Set extension status to running], which means enabling support for PHP files, and confirm.
After the final operation is completed, you can see the newly added item in the [Web Service Extension] list.
2. Add application configuration PHP mapping.
Open Internet Information Services (IIS) Manager->Local Computer->Website->Default Website, right-click [Default Website], select [Properties] in the right-click menu, and the website will appear Property settings window.
Then select the [Home Directory] tab, click the [Configuration] button inside, then click the [Add] button in the [Application Configuration] window, enter [PHP] in [Extension], In the [executable file], add [C:PHPPHP5isapi.dll] mentioned in step 1 above, and the actions are limited to [GET, HEAD, POST].
The above is the detailed content of How to solve the 404 error when building a PHP website on IIS. For more information, please follow other related articles on the PHP Chinese website!