Knowledge Base

Get Expert Website Hosting

Choose website reliability and expertise with SiteGround!

Home / Website Help / PHP Questions / How to enable error reporting in a PHP script?

How to enable error reporting in a PHP script?

Last update: Nov 06, 2025

There are two ways to enable error reporting in your PHP scripts:

1. Add the following function in the script:

error_reporting(E_ALL);

2. Add the following option in your website’s php.ini file:

error_reporting = E_ALL

Both options will enable reporting for all PHP kinds of errors. More information on error reporting and its various options can be found in the official PHP documentation.

At SiteGround PHP error reporting is enabled by default for all hosting accounts.

Web Hosting

Get Your Essential Guide to Fixing Database & PHP Errors

Master database and PHP troubleshooting for a faster, more stable website.

Google reCAPTCHA used. Privacy Policy and Terms of Service apply

Share this article