How to display error prompts in the php browser: 1. Open the php.ini file and change the display_errors=Off value to On; 2. Modify error_reporting; 3. Restart the apache service.
The operating environment of this article: ubuntu16.04 system, PHP7.0 version, DELL G3 computer
How does the php browser display an error message?
php displays an error message on the web page
Modify the php.ini file in ubuntu16.04, php7 environment, in /etc/php/7.0/apache2/php.ini
1. Open the file and search and modify the following line. Change the Off value to On
display_errors = Off
to
display_errors = on
2. Search for error_reporting and modify it as follows:
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
Change to
error_reporting = E_ALL | E_STRICT
3. Finally restart the apache service
sudo /etc/init.d/apache2 restart
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to display error message in php browser. For more information, please follow other related articles on the PHP Chinese website!