Home >Backend Development >PHP Problem >How to set iis7 php error prompt

How to set iis7 php error prompt

藏色散人
藏色散人Original
2021-09-10 09:14:512034browse

iis7 How to set error prompts in php: 1. Modify the content of the PHP configuration file to "display_errors = on;"; 2. Add the web.config file in the root directory of the website.

How to set iis7 php error prompt

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

iis7 How to set php error prompt?

Under IIS7, display PHP errors

In fact, we all know that setting php to display errors, but under iis7/7.5, additional configuration is required . First look at the configuration of php:

display_errors = on;
error_reporting = E_ALL & ~E_NOTICE;

iis configuration. Note that you first need to configure Add the web.config file to the directory:

The code is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
 
http://go.microsoft.com/fwlink/?LinkId=169433
 
  -->
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <system.webServer>
    <httpErrors errorMode="DetailedLocalOnly" existingResponse="PassThrough"></httpErrors>
  </system.webServer>
</configuration>

This is really Baidu’s experience. .

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to set iis7 php error prompt. 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