search
HomeBackend DevelopmentPHP ProblemHow to enable error reporting in php

How to enable error reporting in php

Mar 25, 2021 pm 06:39 PM
phpError message

ph method to enable error prompts: 1. Find and open the configuration file "php.ini" in the PHP installation directory; 2. Find the "display_errors=" item in the file and set its value to "On "; 3. Save the file and restart the apache service.

How to enable error reporting in php

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

In the process of development, It is best to turn on the error message. For some errors, if you do not turn on the error prompt, the error prompt may not appear. This will not achieve technical rigor.

Let’s turn on the error message of PHP

1. Find and open the configuration file php.ini in the PHP installation directory

## 2 , search in the file,

display_errors=

On means the error prompt is on

display_errors=On

Off means the error prompt is off

display_errors=Off

Example demonstration, defining an incorrect PHP syntax

When previewing in the browser, it cannot print correctly, but no error is reported,

Because the current

display_errors=Off, the error prompt is not turned on

Turn on the PHP error prompt, set:

display_errors=On

And save the new settings of the file

Note: After saving the settings, restart the apache service again

Run the file just now

Now the PHP error prompt has been successfully turned on, and error messages can be reported normally

Recommended study: "

PHP Video Tutorial"

The above is the detailed content of How to enable error reporting in php. 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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use