Search code examples
phpapacheubuntu-14.04

How to show errors in php on ubuntu?


Hello everyone I am really new to ubuntu? I just brought a new ubuntu 14 machine. I successfully installed apache2 and php5 but unable to see any warnings or error messages on the browser even though i am generating the errors to see them.

Every thing was working good on my old windows machine with XAMPP.

Now I have set the following values into /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini

error_reporting = E_ALL | E_STRICT display_errors = On display_startup_errors = On

It does not show any errors until I use the following ini_set on each page ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);

P.S. - I have also used echo php_ini_loaded_file(); which shows /etc/php5/apache2/php.ini

Please help me :'(


Solution

  • Check for the "loaded configuration file" in php.ini. If it is the same file then there must be some duplicate "display_errors = Off" line in your php.ini file in your bottom part. The later lines are always taken for execution. So search for all "display_errors" in your php.ini file and remove duplicates. And restart apache. Check phpinfo() output again to find about the "error reporting" variables.