Home >Backend Development >PHP Problem >How to display error message in php
How to display error information in php: 1. Use a text editor to open the php.ini configuration file; 2. Add the code [ini_set("display_errors", "stderr");error_reporting(E_ALL);]; 3. Restart the server.
Specific method:
(Video tutorial recommendation: php video tutorial)
Use first Open the php configuration file in the editor
My php installation directory is /usr/local/php
vim /usr/local/php/etc/php.ini
Then add the following lines of code at the head of the php configuration file
ini_set("display_errors", "stderr"); //ini_set函数作用:为一个配置选项设置值, error_reporting(E_ALL); //显示所有的错误信息
Finally restart the server.
Related recommendations: php training
The above is the detailed content of How to display error message in php. For more information, please follow other related articles on the PHP Chinese website!