Home » Php » apache – PHP doesn't show any kind of errors

apache – PHP doesn't show any kind of errors

Posted by: admin April 23, 2020 Leave a comment

Questions:

I have a PHP server at home for development. It is running:

Ubuntu 9.10
Apache 2.2.12
PHP 5.3.2-0.dotdeb.1
MySql 5.0.7-dev

Currently the settings in the php.ini for displayiong errors are:

display_errors = on
error_reporting = E_ALL

But I do not see any errors in my php script. Also very strange is that phpinfo() shows me this:

display_errors Off

I checked the php.ini file, and restarted the apache server many times, but with no luck. Does anybody knows how this is possible?

edit:
When I localy set this:

ini_set('display_errors', 'on');

I do receive errors.

How to&Answers:

Is the display_errors parameter listed more than once in your php.ini file? If its defined more than once, the second instance of it will override the first.

Answer:

Ubuntu keeps separate copies of the php.ini file for each type of PHP installation.

I’m not familiar with the dotdeb release, but I’d guess it’d be in /etc/php5/apache2/php.ini

Edit:
Since this is apparently not the case, try restarting Apache. PHP won’t pick up changed settings until you do.

Answer:

Enable the following settings as shown below

display_errors

Default Value: On

Development Value: On

Production Value: Off

error_reporting

Default Value: E_ALL & ~E_NOTICE

Development Value: E_ALL | E_STRICT

Production Value: E_ALL &
~E_DEPRECATED

Restart apache server