Home  >  Article  >  Backend Development  >  How to prompt error message in php

How to prompt error message in php

藏色散人
藏色散人Original
2020-09-03 10:43:173135browse

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);

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!

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