Home > Backend Development > PHP Problem > How to prompt error message in php

How to prompt error message in php

藏色散人
Release: 2023-03-05 17:24:02
Original
3143 people have browsed it

How to prompt error information in php: first open the source code; then add the code "ini_set('display_errors', true);error_reporting(E_ALL);" to the head of the file.

How to prompt error message in php

Recommended: "PHP Video Tutorial"

Methods for php to prompt error messages:

Let php display detailed error messages without changing php.ini

error_reporting# There are many ways to use ##. Sometimes when debugging, some files cannot prompt detailed error information, just a 500 error, or nothing is displayed, which brings a lot of trouble to development.

Many methods on the Internet are to change php.ini. This method is not feasible. The environment on the server obviously cannot be changed randomly. Some virtual host users do not have permission to change it. They directly add The code below is the most convenient.

View source code print help

  ini_set('display_errors', true);
  error_reporting(E_ALL);
Copy after login

The above is the detailed content of How to prompt error message in 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