Home / Linux / Configure PHP.ini to show errors – Ubuntu | Display All PHP Errors: Basic & Advanced Usage | Enabling PHP error reporting in Ubuntu Apache

Configure PHP.ini to show errors – Ubuntu | Display All PHP Errors: Basic & Advanced Usage | Enabling PHP error reporting in Ubuntu Apache

Open the php.ini with text editor –

For php 7.2 –

sudo subl /etc/php/7.2/apache2/php.ini

# find and replace

display_errors = On
display_startup_errors = On

You can also do it from your project root index file. Put the following file on your project index.php.

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

Don’t forget to restart apache2..

sudo /etc/init.d/apache2 restart

Hits: 258

%d bloggers like this: