Internet Marketing, SEM, News, Sports, Videos, and Politics Blog
PHP Warnings Off
Turning off all PHP warnings. Depending on your set up, you might be getting a large number of warnings from a PHP script that are written into you Apache log files. Normally, the correct solution would be to fix the script, and all warnings would be eliminated. But on certain occasions, this isn’t an option.
NOTE: Keep a record of any changes you make to your configuration. If you turn off php warnings and don’t remember doing it, you might run into a snag later.
If you’re pressed for time and want to stifle all warnings, add this to the top of any file that is included from your main PHP script.
Now, this won’t just stop the warnings from being printed on the site, but it will also kill all errors being written to your website’s error_log.
If you want to just suppress warnings on your site, and you have access to your .htaccess file, then make a simple edit.
php_value display_errors 0
In order to add error checking back to your website:
php_value display_errors 1
php_value error_reporting 2047
It’s totally up to you how you want to handle error checking, but if you have a script that you don’t plan on changing that is creating error log files of huge sizes, then patching the code as illustrated in example one should do the trick.
| Print article | This entry was posted by Darren on December 29, 2008 at 3:04 pm, and is filed under This and That. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |