How to open php error code prompt

藏色散人
Release: 2023-03-07 20:02:01
Original
2993 people have browsed it

How to open the php error code prompt: first back up the php configuration file; then open the php.ini file; then change "display_errors=Off" to "On"; and finally restart the apache service.

How to open php error code prompt

The operating environment of this tutorial: linux5.9.8 system, PHP5.6 version. This method is suitable for all brands of computers.

Recommended: "PHP Video Tutorial"

php Open error code prompt

Prerequisite environment: Linux Apache2 mysql php

When debugging php, if the newly built environment does not have an error message when running the php web application, you need to manually open it

Method:

Back up php first Configuration file

cp /etc/php5/apache2/php.ini /etc/php5/apche2/php.ini.bak
Copy after login

Open the php.ini file

vim /etc/php5/apache2/php.ini
Copy after login

Then enter '/' in the terminal to enter the search state

Enter the search keyword display_errors, press Enter to search and press n to proceed Search down

Change display_errors = Off to On

Press i to enter insert mode and make modifications

After completion, press ESC to exit the insert Mode and then press: wq to save

Then enter '/' in the terminal to enter the search state

Enter the search keyword error_reporting, press Enter to search and press n to proceed Search down

The steps are the same as above


I added & ~E_NOTICE here, which means ignore all Notice warnings and do not report them,

Add or output the error message you want to block based on your actual situation

Then: wq save the file

Finally you need to restart the apache service

/etc/init.d/apache2 restart
Copy after login

or

service apache2 restart
Copy after login

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of How to open php error code prompt. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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