I just can't get this figured out. I changed php.ini display_errors = On to do some debugging. Changed it back to = Off, but the errors still display. This is on Mac OS X 10.4.2, running Apache and MySQL.

I even went as far as to run a

grep -rli 'display_errors = On' /

and not a single file contains that string. I have rebooted and also powered down and restarted, but still the echo(php_info()); shows it as display_errors = On.

I tried

ini_set('display_errors', 'Off');

and the php_info() shows display_errors = Off, but still they display.

Its really beginning to get irritating. Any thoughts on why this could be happening? (The problem, not the irritation.....)

    Might I suggest Gold Bond Medicated powder for the irritation? 😉

    Do you have a .htaccess file that sets display_errors? Have you also tried setting your error_reporting level to 0 (for none)?

    Also, make sure log_errors is on. I'm not 100% sure, but maybe, just maybe if log_errors is off, and you turn display_errors off, it defaults to displaying the error because it can't log it.

      log_errors is set to = ON. This is beginning to drive me insane. If I do set error_reporting to 0, won't that supress log entries as well? I would still like the errors logged, at least.

        Have you tried to specifically reboot just Apache?

        Can you post what your error section of your php.ini looks like? Also can you verify that the path to the php.ini in phpinfo() is indeed the path to your php.ini that you've modified? Can you also verify that you didn't modify php.ini-recommended or php.ini-distribution or whatever they're called?

          I have killed and reloaded Apache countless times, but no change in the php_info() output. Still shows error_reporting = On..... What a pisser.

          Here is the php.ini errors section from the file php_info() claims to be using.

          ; Print out errors (as a part of the output).  For production web sites,
          ; you're strongly encouraged to turn this feature off, and use error logging
          ; instead (see below).  Keeping display_errors enabled on a production web site
          ; may reveal security information to end users, such as file paths on your Web
          ; server, your database schema or other information.
          

          I even commented the original line out,

          ;display_errors = Off
          

          and rekeyed it in case there was a bad linefeed or something.

          display_errors = Off
          
          ; Even when display_errors is on, errors that occur during PHP's startup
          ; sequence are not displayed.  It's strongly recommended to keep
          ; display_startup_errors off, except for when debugging.
          display_startup_errors = Off
          
          ; Log errors into a log file (server-specific log, stderr, or error_log (below))
          ; As stated above, you're strongly advised to use error logging in place of
          ; error displaying on production web sites.
          log_errors = On
          
          ; Set maximum length of log_errors. In error_log information about the source is
          ; added. The default is 1024 and 0 allows to not apply any maximum length at all.
          log_errors_max_len = 1024
          
          ; Do not log repeated messages. Repeated errors must occur in same file on same
          ; line until ignore_repeated_source is set true.
          ignore_repeated_errors = Off
          
          ; Ignore source of message when ignoring repeated messages. When this setting 
          ; is On you will not log errors with repeated messages from different files or
          ; sourcelines.
          ignore_repeated_source = Off
          
          ; If this parameter is set to Off, then memory leaks will not be shown (on
          ; stdout or in the log). This has only effect in a debug compile, and if 
          ; error reporting includes E_WARNING in the allowed list
          report_memleaks = On
          
          ; Store the last error/warning message in $php_errormsg (boolean).
          track_errors = Off
          

          I don't see any reason for it to report errors to the browser, but maybe someone else's eyes will catch something I missed.

            If phpinfo() isn't reflecting changes made in php.ini, PHP isn't using your php.ini file. I'm not familiar with setting up PHP on a Mac, so I can't help you much there...

              did u try commenting out other parts together? it may help you narrow it down.

                Well, after several hours, I finally figured it out. It was right there in the Apache log.

                PHP:  Error parsing /Applications/MAMP/conf/php5/php.ini on line 270

                Seems I left out the '&' in error_reporting = E_ALL & ~E_NOTICE.

                Who feels like a retard now? I do. :eek:

                Thanks for all of the suggestions!

                  Write a Reply...