How To Hide Deprecated PHP Errors in OS-Commerce

This problem cropped up recently where an old os-commerce installation started showing “Deprecated function” errors all of a sudden. I think it coincided with a server and php upgrade here but the main reason is os-commerce being an old piece of software. The site functionality was fine but there was a shit load of php errors all over the place which totally messed up the design and layout:

Deprecated: Function ereg_replace() is deprecated in /home/nautybit/public_html/includes/classes/seo.class.php on line 1299

That particular line above is from a module I added to this os-commerce but there were other areas of the site showing errors for default os-commerce functions.

Basically, you need to turn off php error reporting in your script/app or at least change it to not show deprecated errors. I done that in os-commerce by editing the following lines in “includes/application_top.php” and “admin/includes/application_top.php”.


error_reporting(E_ALL & ~E_NOTICE);


error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);


Published by

Leon Quinn

Multimedia Design company in Leitrim, Ireland specializing in WordPress Website Design, Photoshop and Graphics.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.