Home  >  Article  >  Backend Development  >  How to configure php current page error settings

How to configure php current page error settings

王林
王林Original
2021-06-25 09:34:282648browse

The way to configure the error reporting settings of the current page of PHP is to add the configuration [ini_set('display_errors', 'On');error_reporting(E_ALL);] in the PHP code.

How to configure php current page error settings

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

When debugging PHP code, in order to quickly locate errors, we usually turn on error message prompts.

So how do we configure the error reporting settings of the current page? Let us take a look below.

The error_reporting() function specifies which error to report. This function sets the error reporting level of the current script. This function returns the old error reporting level.

The specific settings are as follows:

ini_set('display_errors', 'On');
ini_set('memory_limit', '64M');

//报错,详细
error_reporting(E_ALL);

//不报错 
error_reporting(0)

Learning video sharing: php video tutorial

The above is the detailed content of How to configure php current page error settings. 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