Lyynk424 Posted April 15, 2012 Share Posted April 15, 2012 I've been pulling my hair out over this problem. And the thing is, everything still runs perfectly fine, it's just that the error message below is written to /var/log/apache2/error.log everytime there is a visit to my site (which is often). Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 I am running Debian 6, Apache 2.2.16, and PHP 5.3.3. I have done the following to try to fix this... from / grep -r 'magic_quotes_gpc' / This pulled up 3 different php.ini files with references to magic_quotes_gpc. I tried setting them all to off, and I also tried commenting them all out. Both still result in error spam to the log. I have a test page on my server that runs phpinfo(); and the changes I make in php.ini are correctly reflected. When I turn magic_quotes_gpc off, it shows it as off there and vice versa. I've tried commenting out all the references to magic_gpc_quotes and then turning it off via .htaccess file, which didn't work either. I've run out of ideas and I can't seem to narrow down where this problem is coming from. I'm rather new to the whole dedicated server realm, so any guidance would be greatly, greatly appreciated. I'd be happy to provide any other necessary information. Thanks. Quote Link to comment Share on other sites More sharing options...
MarPlo Posted April 17, 2012 Share Posted April 17, 2012 Hi, Maybe the problem is in the php script, which uses get_magic_quotes_gpc() function, something like: if(get_magic_quotes_gpc()) ... In this case, the get_magic_quotes_gpc() must be deleted from code, and perhaps to rewrite that part of script. Quote Link to comment Share on other sites More sharing options...
Lyynk424 Posted April 17, 2012 Author Share Posted April 17, 2012 Thanks for replying. I actually wrote the entirety of the code that my site uses and never use magic_gpc_quotes. I did a search just in case, and it returned 0 results. =/ I mean, I guess it's not a huge deal... I have log rotation setup on the server, so I'm just deleting the old logs... it's just really bothering me that I can't figure out why this error is happening. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 17, 2012 Share Posted April 17, 2012 The error will be emitted if the magic_quotes_gpc setting is ON for any reason. Sadly, the default is on for a lot of the php versions, when there is nothing specifically setting it to an off value. Start my checking which php.ini is being used. It is the Loaded Configuration File value in the phpinfo output. You should set magic_quotes_gpc to off magic_quotes_gpc = Off and then restart your web server to get any changes made to the php.ini to take effect. Next, make sure there are no local php.ini files (when php is running as a cgi application) or .htaccess files (when php is running as an Apache server module) that is setting it to an on value. Did your phpinfo output for the magic_quotes_gpc setting show both a master and local value? What exactly did they show? A syntax error in the setting will display what the setting is, but the setting doesn't actually take effect. If all else fails, you can factor out the depreciated error setting from the error_reporting setting. Quote Link to comment Share on other sites More sharing options...
Lyynk424 Posted April 19, 2012 Author Share Posted April 19, 2012 Thanks for the reply... I've actually tried all of that. On my phpinfo() output it shows the correct file as being loaded and magic_quotes_gpc is set to "Off" in both variable slots. I've tried completely commenting out the magic_quotes_gpc lines (which defaults to on), and I've tried commenting out the magic_quotes_gpc and then setting it off in .htaccess. I think it may be an issue with "PHP protected by Suhosin." I need to do more research into the matter, but this is the only place left that I haven't searched on my server. There is no reference to magic_quotes_gpc that grep finds, but maybe it creates one under certain circumstances or something. If I find a solution to this problem, I'll post here and let you guys know just in case anyone else experiences this in the future. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.