How to enable error prompts in ubuntu php

藏色散人
Release: 2023-03-06 13:20:01
Original
2073 people have browsed it

How to enable error prompts in ubuntu php: First open the php.ini file; then modify the content to "/display_errors = On"; then modify Apache's httpd.conf; and finally restart Apache.

How to enable error prompts in ubuntu php

Recommended: "PHP Video Tutorial"

is learning PHP When doing so, turning on error prompts can enable beginners to quickly find the source of code errors. However, after installing PHP, the error prompt function is turned off by default, so it needs to be turned on again.

The opening steps are as follows:

1. Open the php.ini file.

In Ubuntu system, this file is in: /etc/php5/apache2 directory.

          sudo vim <span style="font-size:24px"> <span style="font-size:18px">/etc/php5/apache2/php.ini </span></span>

2. Search and modify the following line, change the Off value to On

After opening the php.ini file, use

##                                                                                                                    <span style="font-size:24px"><span style="font-size:18px"></span></span>

##display_errors = Off this line of code. The results are as follows: ##                                                                                                                                                                                                                                                     Change the value to On. 3. Press the "Esc" key to exit the edit mode, and search for the following line according to the method in step 2 error_reporting = E_ALL & ~E_NOTICE Or search:

4. Modify Apache’s httpd.conf, Under the Ubuntu system, this file is in the /etc/apache2/ directory. This is a blank file.

Add the following two lines:

## PHP_FLAG Display_ERRORS on PHP_VALUE ERROR_Reporting 2039 # 5. Restart Apache, and it is OK.

Restart command: :sudo /etc/init.d/apache2 restart

## I deliberately put After correcting the code of a php file and then running it, you can see an error message.



The above is the detailed content of How to enable error prompts in ubuntu php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template