Contrary to most people's problem I cannot get PHP to stop showing errors, I have in my php.ini display_errors set to off but it still shows them, I have also tried .htaccess, and inline ini_set and error_reporting variables but the errors still show.

What can I do to prevent this overide?

Mac OS X Lion Server 10.7.1 MAMP Compiled using instructions from DIY Mac Server (diymacserver.com)


This is where my php.ini file is stored...

This is where my php.ini is

This is the value of my display_errors setting at run time

This is the value of my display_errors

And this is the copy and paste value written in /etc/php.ini

display_errors = Off
  • 1
    Have you checked phpinfo() to make sure you're using the same php.ini that PHP is using (also, whether it says its on or off)? – DerfK Sep 2 '11 at 23:55
  • I had not but I have now and it was correct, I changed short tags to on in there and that worked so it's working and reading the file, but its not adhering to the settings for error reporting. – unknowndomain Sep 3 '11 at 11:30
  • I have added some more detail about my configuration – unknowndomain Sep 3 '11 at 11:41
  • I have managed to figure out that its happening because my php.ini isn't being read although its in place, can anyone suggest what permissions would be correct for a Apache 2 install running as _www in the group _www (mac os x) – unknowndomain Sep 7 '11 at 18:44

make sure your editing the right php.ini file as there are two ini files, one for apache and one for CLI.

  • Yes I am editing the right file, as I managed to enable short tags successfully. – unknowndomain Sep 3 '11 at 11:31

I came across similar behaviour recently and found out that the php.ini layout is quite confusing: listing of the default values etc. is at the top of the file while description of the setting and the setting itself are way further down. (see php 7 ignores ini files, but claims to load).

  1. It could well be that a later setting overrides yours. Browse or search the ini file for all occurences of "display_errors": grep -n display_errors/etc/php.ini
  2. What is the value of "Loaded Configuration File "?

The display_errors directive can be altered at runtime with the ini_set function. Make sure that none of the code is turning error display back on.

Also, when you update php.ini settings, make sure to restart Apache.

  • Indeed it can and I have tried that but it still shows errors... – unknowndomain Sep 3 '11 at 11:31

Do you have an auto_append_file= setting that is causing php to include code on every page that uses ini_set() to turn the display back on?


It is worth bearing in mind that even if you don't display or log errors, they still have a big impact on throughput and performance.

The 3 most obvious causes are:

1) you are changing the wrong php.ini file (which you've already addressed).

2) the php.ini setting is over-ridden somewhere else - if this is mod_php then that could be in the httpd.conf files or .htaccess

3) you didn't restart the PHP process (httpd when we're talking about mod_php) after making the changes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.