How to display all errors and warnings in Apache2/PHP5 - Ubuntu 14.04


Do you receive blank screen without any idea of what errors and warnings you have right now ? In this guide we will learn how we can enable the full PHP warnings and errors.


Step 1: Edit the PHP configuration.

In Ubuntu 14.04 we must find our PHP configration file (php.ini) for our Dedicated Server or VPS with the following command:

nano /etc/php5/apache2/php.ini

Then we have to find:

display_errors = off

and replace it with:

display_errors = on


Step 2: Apply the changes.

After we made the changes to the configuration file it's time to apply the changes. To do so just restart the Apache server with the following command:

service apache2 restart

Note: Now your Apache server will display all warnings and errors in your website. This may be a problem. So if you need to hide all the warnings you receive add this in the top of the files in which you receive warnings which you want to hide:

error_reporting(E_ERROR | E_PARSE);

We advice you to correct all warnings and errors instead of hiding them.



Share this post

Comments (0)

    There are no comments to this topic yet.

To post comments you must have account with VivasHost! To create an Account you must purchase any service you want.

Take a look at our VPS - Virtual Private Servers or our Dedicated Servers.