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.
error_reporting() is a function. Try:
error_reporting(E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED);
. Orini_set("error_reporting", E_ALL & ~E_DEPRECATED);
. Then test the settings with echoini_get("error_reporting");
. Minimal PHP version must be 5.3.0 for that.Try replacing your
mysql_connect()
withmysqli_connect()
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:
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.
WordPress sets the
error_reporting
toE_ALL
in its config files, thus overriding whatever you’ve set inphp.ini
. I beleieve settingerror_reporting(E_ALL ^ E_DEPRECATED)
inwp-config.php
clears it up. See Turn off deprecated errors php 5.3 for various and sundry variations on that setting.setting:
define('WP_DEBUG', false);
to false fixed the issue.