2011/11/07

Set Magic Quotes Runtime is deprecated

I see a lot of error in logs regarding set magic quotes runtime is deprecated on one of my wordpress site running the nginx server. The error is like the following,
2011/11/07 12:02:48 [error] 15798#0: *130087 FastCGI sent in stderr: \"PHP Deprecated:  Function set_magic_quotes_runtime() is deprecated in /var/www/example/content/wp-settings.php on line 32\" while reading response header from upstream, client: 173.13.114.113, server: www.example.com, request: \"GET /news/ HTTP/1.1\", upstream: \"fastcgi://unix:/var/run/www/php.sock:\", host: \"www.example.com\", referrer: \"http://www.example.com/\"
I already turn off Deprecated error in php.ini, but Not sure why it does not stop. The bad thing is that a lot of deprecated errors make the important error message hidden, so I got the fix this. Finally, the solution is edit wp-settings.php on line 32 to
//set_magic_quotes_runtime( 0 );
//110711 - Since this function is depracted as of PHP 5.3, use ini_set('magic_quotes_runtime', 0); instead.
@ini_set( 'magic_quotes_runtime', 0);

Ref: http://php.net/manual/en/function.set-magic-quotes-runtime.php


No comments:

Post a Comment