search
HomeTopicsIISHow to solve the 404 error when building a PHP website on IIS

How to solve the 404 error when building a PHP website on IIS

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
IIS: Examining Its Current Usage and PopularityIIS: Examining Its Current Usage and PopularityApr 29, 2025 am 12:08 AM

IIS is still used and popular in the current market, especially in enterprise-level and Windows environments, but faces competition for open source web servers. 1) IIS has a place in enterprises using Windows servers because of its close integration with Microsoft products. 2) However, it is less used in open source communities and small websites because Apache and Nginx are more popular. 3) IIS's market share is gradually declining, but it is still common in corporate intranets and government agencies. 4) Personal experience shows that the IIS management interface is intuitive and integrates well with ASP.NET, but its high concurrency performance is not as good as Apache or Nginx.

Is IIS Still a Viable Option for Web Hosting?Is IIS Still a Viable Option for Web Hosting?Apr 28, 2025 am 12:15 AM

IIS is still a viable web hosting option, especially for enterprise applications that rely on Windows environments. 1) IIS is tightly integrated with Windows, providing rich management tools and security features. 2) Excellent in high concurrency and ASP.NETCore applications. 3) Modular design supports high scalability. 4) Provides powerful security features such as authentication and SSL/TLS support.

IIS's Capabilities: Performance and SecurityIIS's Capabilities: Performance and SecurityApr 27, 2025 am 12:26 AM

How does IIS perform in terms of performance and security? IIS is optimized in terms of performance by enabling compression, tuning application pool settings and performance monitoring; in terms of security, it is protected by enabling HTTPS, restricting IP access and security monitoring, but it also faces some challenges.

IIS's Status: A Look at Web Server TrendsIIS's Status: A Look at Web Server TrendsApr 26, 2025 am 12:14 AM

IIS performs well in the web server market, especially in the Windows environment. 1) IIS's high performance and stability make it popular in enterprise-level applications. 2) Its security is guaranteed through integrated firewalls and regular security patches. 3) The ease of use of IIS is due to its management tools and integrated development environment. 4) Although it is not as good as Apache and Nginx in terms of cross-platform and open source support, IIS's integration and ease of use under Windows are its advantages.

PHP on IIS: The Benefits and ChallengesPHP on IIS: The Benefits and ChallengesApr 25, 2025 am 12:09 AM

Running PHP on IIS is feasible, with significant advantages and some challenges. 1) IIS is well integrated with Windows, providing security and management tools. 2) FastCGI supports improving PHP performance. 3) Microsoft provides official support and documentation. However, configuration and optimization require attention to the PHP handler path and FastCGI settings to ensure efficient operation.

IIS: The Longevity of the Microsoft Web ServerIIS: The Longevity of the Microsoft Web ServerApr 24, 2025 am 12:10 AM

IIS maintains its vitality in the highly competitive web server market mainly because of its tight integration with Windows, support for ASP.NET and rich management capabilities. 1) Integration with Windows simplifies security management of web applications; 2) Native support for ASP.NET makes it the first choice for .NET developers; 3) Powerful management tools are easy to configure and monitor. Despite the challenges in cross-platform applications, IIS can still play its strengths by combining other technologies.

IIS: Managing Websites and Web ApplicationsIIS: Managing Websites and Web ApplicationsApr 23, 2025 am 12:07 AM

IIS is a web server software developed by Microsoft to host and manage websites and web applications. Here are the steps to efficiently manage IIS: 1. Create websites and web applications, using PowerShell commands such as New-WebSite and New-WebApplication. 2. Configure the application pool to optimize performance and security. 3. Use IIS Manager or PowerShell scripts for daily management, such as starting, stopping and viewing website status. 4. Use advanced features such as URL rewriting, load balancing and cluster management to improve SEO and website performance. 5. Troubleshoot common errors by viewing IIS log files. 6. Optimize performance, including compressing static content, setting cache policies and optimization

The Compatibility of IIS and PHP: A Deep DiveThe Compatibility of IIS and PHP: A Deep DiveApr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),