How to Enable PHP errors to Display on Web Browser

Channel: Linux
Abstract: php ini_set('display_errors'add this code to your index.php or other default load script.

This tutorial will help you to enable PHP errors to display on the web browser. This is helpful for debugging purpose.

First of all, enable display_errors parameter in your php.ini configuration file.

display_errors = on

Then, add the following code to your the application PHP script. For example, add this code to your index.php or other default load script.

<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);12345<?php ini_set('display_errors', 1);ini_set('display_startup_errors', 1);error_reporting(E_ALL);

Here is a sample index.php with enabled error to display on browser.

Ref From: tecadmin
Channels: PHPloggingerror

Related articles