Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turning off Deprecation warnings in PHP.ini file WAMP

Tags:

php

I am working on project @ home and using WAMP for development. Currently the php.ini file has the following lines set like this:

error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On

I had hoped in doing so it would prevent deprecation warnings from showing up. However it is not. Is there a way I can adjust error_reporting to ignore deprecated warnings.

Output I am getting currently:

Screen of the problem

like image 984
Javacadabra Avatar asked Jul 03 '14 17:07

Javacadabra


4 Answers

You can use this function :

error_reporting(E_ALL ^ E_DEPRECATED); 

http://www.php.net/manual/en/function.error-reporting.php

Or use "@" operator before function name.

@mysql_connect(); 
like image 80
Sky Voyager Avatar answered Sep 25 '22 13:09

Sky Voyager


In your php.ini file change the following.. (note wamp has 2 different php.ini files so make the changes on both)

from this

error_reporting = E_ALL 

to this

error_reporting = E_ALL & ~E_DEPRECATED 
like image 24
Ryan Augustine Avatar answered Sep 25 '22 13:09

Ryan Augustine


I had the same problem. It turned out however, that I edited wrong php.ini file. In my case the correct one was

C:\wamp64\bin\php\php5.6.25\phpForApache.ini

and in this file I have changed this line to:

error_reporting = E_ALL & ~E_DEPRECATED.

It didn't make any difference what I had changed in that "obvious" php.ini file.

like image 35
n-dru Avatar answered Sep 23 '22 13:09

n-dru


Set your error report to

error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

on your php page.

like image 45
seyi_php Avatar answered Sep 21 '22 13:09

seyi_php