Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem of ubuntu php shutdown warning

Shulou Source: shulou.com Published: 2022-06-02 01:43:52 09月20日 Update

This article mainly explains "how to solve the ubuntu php shutdown warning problem". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to solve the ubuntu php shutdown warning problem.

Ubuntu php shutdown warning solution: 1, open the php configuration file php.ini;2, change "display_errors=Off" to "display_errors=On"; 3, modify Apache httpd.conf;4, restart Apache.

Operating environment: Ubuntu 14.04 system, PHP5 version, DELL G3 computer

What about the ubuntu php shutdown warning?

In Ubuntu 14.04, the default PHP development environment configuration does not prompt for all warnings and error messages. This is very painful for developers. Record the configuration method here and save it for future use. The editor has also found two kinds, oh, the first one is very simple, but the step span is larger, and the second, the steps are so detailed that they cannot be more detailed. Take it away as you like.

Stripped-down steps:

1. Modify php configuration file php.ini

The code is as follows:

Sudo gedit / etc/php5/apache2/php.ini

Change display_errors = Off to display_errors = On

Change error_reporting = xxx to error_reporting = E_ALL | E_STRICT

2. Restart apache

The code is as follows:

Sudo / etc/init.d/apache2 restart

OK! Enjoy it!

Detailed version steps

1. Open the php.ini file.

Take my ubuntu as an example, this file is in the: / etc/php5/apache2 directory.

two。 Search and modify the following line to change the off value to On

The code is as follows:

Display_errors = Off

3. Search for downlink

The code is as follows:

Error_reporting = E_ALL & ~ E_NOTICE

Or search for:

The code is as follows:

Error_reporting = E_ALL & ~ E_DEPRECATED

Modify to

The code is as follows:

Error_reporting = E_ALL | E_STRICT

4. Modify the httpd.conf of Apache

Take my Ubuntu as an example, this file is in the: / etc/apache2/ directory, this is a blank file.

Add the following two lines:

The code is as follows:

Php_flag display_errors onphp_value error_reporting 2039

5. Restart Apache and you will OK.

Restart command:

The code is as follows:

: sudo / etc/init.d/apache2 restart

Ok! Error message opened successfully!

Thank you for your reading, the above is the content of "how to solve the ubuntu php shutdown warning problem". After the study of this article, I believe you have a deeper understanding of how to solve the ubuntu php shutdown warning problem, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Code files problems steps configuration learning search content environment directories errors development prompts larger successful painful information methods commands that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MariaDB vpn Redmi Docker