Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set error messages in php.ini

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this article "php.ini how to set error messages", so the editor summarizes the following contents, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to set error messages in php.ini" article.

In PHP, you can use the "display_errors" in the "php.ini" file to set the error message. When "display_errors" is set to "On", it means to turn on displaying the error message, and when the content is set to "Off", it means to turn off displaying the error message.

This article operating environment: Windows10 system, PHP7.1 version, Dell G3 computer

How to set the error message for php.ini

The setting method of opening error report in PHP configuration file php.ini

Windows system switch php error message

If you do not have permission to modify php.ini, you can add the following code to the php file:

The code is as follows

Ini_set ("display_errors", "On"); error_reporting (E_ALL | E_STRICT)

Of course, if you can modify php.ini, you can do the following:

The code is as follows

Find display_errors = On and change it to display_errors = off

Note: if you have copied the PHP.ini file to the windows directory, you must also change the display_errors = On in c:windows/php.ini to display_errors = off

The solution to the failure of display_errors = Off in PHP .ini

Expand knowledge:

The method of turning on and off the error prompt in linux system is similar, but I will introduce it to you in detail.

Under the linux system

1. Open the php.ini file.

Take my ubuntu as an example, this file is in the: / etc/php5/a (www.jb51.net) pache2 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:

Error_reporting = E_ALL & ~ E_DEPRECATED

Modify to

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

The above sudo / etc/init.d/apache2 restart is about the content of this article on "how to set error messages in php.ini". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report