In this page we will help you configure PHP to display messages when an error occurred while accessing a PHP file via your web browser. If PHP errors occurred, you will get a blank page. This will not be helpful, especially when you want to know the cause of these errors to be able to fix them.

Under Ubuntu, start the terminal (Ctrl+Alt+T) and edit php.ini with this command for PHP5:

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

For PHP4, edit php.ini with this command:

sudo gedit /etc/php4/apache2/php.ini

Press Ctrl+F and search for this line:

display_errors = Off

Replace it with this line to set it on:

display_errors = On

Press Ctrl+Q and save your file.

PHP will now return errors instead of displaying a blank page.

Note: This tip is workable under Ubuntu (12.04/11.10/11.04 or older) provided that a web server is installed with Apache 2.x.x and PHP 4 /5.

Post a Comment