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

How to display PHP errors on web browser

不言
Release: 2023-04-05 10:16:01
Original
5540 people have browsed it

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
Copy after login

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);
Copy after login

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!

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