Home>Article>Backend Development> How to check the error message when php reports 500 error

How to check the error message when php reports 500 error

王林
王林 Original
2021-06-24 10:54:13 2468browse

The way to view the error information when reporting a 500 error in php is to add [ini_set("display_errors","On"); error_reporting(E_ALL);] to the code.

How to check the error message when php reports 500 error

The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.

When debugging PHP code, we need to quickly locate the error through error prompts, and then modify the code.

Usually we use two methods to turn on error prompts, one is to directly modify the php.ini configuration file, the other is to add [ini_set("display_errors", "On"); in the php code 】.

So when we are debugging the code, if a 500 error occurs, how should we check the error message?

Specific method:

Add the following two lines of code to the execution code

ini_set("display_errors","On"); error_reporting(E_ALL);

Free learning video sharing:Programming video

The above is the detailed content of How to check the error message when php reports 500 error. 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