Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 (


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
share|improve this question
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
Awesome thanks! – John Ballinger Sep 7 '11 at 0:51
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.

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

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.

share|improve this answer
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?

share|improve this answer
It is set to blank – unknowndomain Sep 4 '11 at 6:37

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 "?
share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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