Home >Backend Development >PHP Problem >How to display error message in php browser

How to display error message in php browser

藏色散人
藏色散人Original
2021-07-15 09:07:572671browse

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.

How to display error message in php browser

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!

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