10 April 2016

Display in-page PHP error reporting

In-browser/in-page errors are by default turned off in php runing on apache. Obviously, you’ll only want to do this during the development phase and not when you go to production.

Here’s how to turn on PHP’s in-page error reporting on Ubuntu when developing locally.

Method 1


sudo nano /etc/php5/apache2/php.ini


display_errors = Off

Replace the parameter ‘Off’ with ‘On’.

display_errors = On

Restart Apache

sudo /etc/init.d/apache2 restart

Method 2

Create a .htaccess file in your app’s root directory.

Add these three lines

php_value error_reporting -1 
php_value display_errors stdout 
php_flag display_startup_errors on

No comments:

Post a Comment