Can’t seem to turn off deprecated errors in php

Im on a development server using a version of php that doesn’t support mysql_connect() our production server does. I have tried: error_reporting = E_ALL ^ E_DEPRECATED but it doesn’t work. After restarting Apache I still the deprecated error message.

I have access to the ini file I should not need php functions to change the error reporting. this is also for wordpress.

Related posts

Leave a Reply

5 comments

  1. error_reporting() is a function. Try: error_reporting(E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED);. Or ini_set("error_reporting", E_ALL & ~E_DEPRECATED);. Then test the settings with echo ini_get("error_reporting");. Minimal PHP version must be 5.3.0 for that.

  2. Are you sure that you’ve modified the correct php.ini? Often there are several included with an install. Is this happening on your local development machine, or on a live server? The best way to make sure you’ve modified the right php.ini is to run a phpinfo file.

    Create a new file, name it phpinfo.php and write:

    <?php echo phpinfo(); ?>
    

    Run this script in your browser and go down to the line that says “Loaded Configuration File”

    This used to cause me headaches when using a WAMP install.