Home  >  Article  >  Backend Development  >  How to display PHP errors on web browser

How to display PHP errors on web browser

不言
不言Original
2019-02-19 09:41:335503browse

Displaying PHP errors on the browser is helpful for program debugging, so how to display PHP errors on the browser? This article will teach you how to display PHP program errors on the browser so that we can debug the program. Let's take a look at the specific content.

How to display PHP errors on web browser

#First, we need to enable the display_errors parameter in the How to display PHP errors on web browser.ini configuration file.

display_errors = on

Then, add the following code to the application PHP script. For example, add this code to index.How to display PHP errors on web browser or other default loading script.

<?How to display PHP errors on web browser
 
ini_set(&#39;display_errors&#39;, 1);
ini_set(&#39;display_startup_errors&#39;, 1);
error_reporting(E_ALL);

This is a sample index.How to display PHP errors on web browser showing enabled errors on the browser.

enable-How to display PHP errors on web browser-errors.png

This article has ended here. For more exciting content, you can pay attention to other related column tutorials on the PHP Chinese website! ! !

The above is the detailed content of How to display PHP errors on web browser. 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