3

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.

ultranaut
  • 2,132
  • 1
  • 17
  • 22
Adam
  • 609
  • 2
  • 8
  • 15

5 Answers5

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.

CAPS LOCK
  • 1,960
  • 3
  • 26
  • 41
  • I have access to the php ini file why am I not making these changes here – Adam Oct 19 '13 at 16:10
  • Ok, i haven't seen that in original answer. Then in php.ini find error_reporting and change it to error_reporting = E_ALL & ~E_DEPRECATED. Does it work? – CAPS LOCK Oct 19 '13 at 16:17
0

Try replacing your mysql_connect() with mysqli_connect()

0

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.

Casper Wilkes
  • 899
  • 11
  • 14
  • One: I hate developing any kind of web app, rails, php or what ever on windows, two: Linux php install comes with one php.ini that I know of and its the one I have been editing all along: /etc/php5/apache2/php.ini, and yes I restart apache after i edit, and refresh the page – Adam Oct 19 '13 at 16:29
0

WordPress sets the error_reporting to E_ALL in its config files, thus overriding whatever you've set in php.ini. I beleieve setting error_reporting(E_ALL ^ E_DEPRECATED) in wp-config.php clears it up. See Turn off deprecated errors php 5.3 for various and sundry variations on that setting.

Community
  • 1
  • 1
ultranaut
  • 2,132
  • 1
  • 17
  • 22
0

setting: define('WP_DEBUG', false); to false fixed the issue.

Adam
  • 609
  • 2
  • 8
  • 15