Skip to main content

How to disable PHP 5.3 Deprecated errors

If you installed PHP 5.3, then you may have noticed many deprecated errors from older web apps and even current ones--like some drupal modules.

NOTICE: this is not a true fix, you could be ignoring critical errors by doing the following... but most likely you should be fine... though make sure you do not log errors, or your log files will quickly grow to an unmanageable size.

anyhow...

via php.ini :

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
; change this to Off if you still get errors.
display_errors = On
log_errors = Off

also, some sites may be using their own .htaccess or error_reporting... therefore you may need to go to affected ones and modify the .htaccess file and insert the following to disable PHP 5.3 ... I had to do this for really old web apps.

php_flag display_errors off
php_flag log_errors off

after your done... as always, restart apache...

service httpd restart

Comments

Thats your advice? Turn them

Thats your advice? Turn them off? Nice... :-/

I did but the same

I did but the same problem.
"Deprecated: Function set_magic_quotes_runtime() is deprecated "

its ugly, but if you have to

its ugly, but if you have to run 3rd party php code you want to see the more important errors.

btw, you can selectively supress warnings for single things by putting an @ in front of the call. like @ereg(...) instead of ereg(...)
note that this is even worse than turning warnings off: you don't even notice in config files that you disabled something. and it also won't show any other warnings, its not just supressing depricated.

btw: depricated ultimately means you have to fix the code because some next release of php is going to remove that old function.

Thank you! It was the right

Thank you! It was the right solution on my LAMP. No more errors on some joomla modules.

thank so mush

thank so mush

Function split() is

Function split() is deprecated. I can't get rid of this message

Post new comment

The content of this field is kept private and will not be shown publicly.