Home > Backend Development > PHP Problem > What should I do if PHP cannot display error messages in IIS environment?

What should I do if PHP cannot display error messages in IIS environment?

coldplay.xixi
Release: 2023-03-03 19:48:01
Original
2642 people have browsed it

Solution to the problem that PHP cannot display the error message in IIS environment: 1. Change the PHP configuration file [php.ini]; 2. Create a new [web.config] file under the root directory of the website and add Corresponding code; 3. Install the component [VCRUNTIME140.dll].

What should I do if PHP cannot display error messages in IIS environment?

Solution to PHP failing to display error message in IIS environment:

1.PHP

First open the PHP configuration file php.ini and make the following configuration changes:

  • log_errors = On

  • html_errors = On

  • display_errors = On

  • fastcgi.logging = 0

  • ##error_reporting = E_ALL & ~E_NOTICE

Related learning recommendations:

php graphic tutorial

can be modified according to your own needs

  • # Extension = PHP_CURL.DLL Open the CURL mode

  • # EXTENSION = php_opensl.dll. #extension = php_pdo_mysql.dll Open the database transaction processing

  • # EXTENSION_DIR = "C: \ PHP \ EXT"; Set the PHP module path .timezone = PRC/ “Asia/Shanghai” ;Set the time zone to China time zone

  •             short_open_tag = On; cgi.Force_redirect = 0; Open the way to run in CGI. Why not change this item for the time being? # error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED ;Modify the error reminder to the standard mode

  • 2.Web site

  • in Create a new web.config file under the root directory of the website

    Add the following code:
  • <?xml version="1.0" encoding="UTF-8"?>
    <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>
    Copy after login
  • 3. Run cmd to enter the directory, and when executing PHP, a pop-up window will prompt: Unable to start this program because VCRUNTIME140.dll is missing from your computer.

  • Running php7 under Windows requires Visual C Redistributable 2015. The previous version does not need to be that high. The latest version of Apache may also require this component. This component is a C application created by running Visual Studio 2015. The necessary components can be solved by installing them. You can directly go to the Microsoft official website to download the installation program.

  • Related video recommendations:
  • PHP programming from entry to proficiency

The above is the detailed content of What should I do if PHP cannot display error messages in IIS environment?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template