Call to undefined function set_magic_quotes_runtime()

Viewed 53832

So, on my website I'm getting this error:

Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /homepages/4/d661770438/htdocs/awptical/initdata.php:382 Stack trace: #0 /homepages/4/d661770438/htdocs/awptical/index.php(21): require_once() #1 {main} thrown in /homepages/4/d661770438/htdocs/awptical/initdata.php on line 382

Does anybody know what this means?

2 Answers

The function no longer exists in PHP 7, nor the setting it works with, so you will need to remove its usages. You will need to save the current state of your code and try to remove all the instances of this function call and see whether the site is working and if so, whether it is working as you expect it to work. Alternatively, you can implement a dummy version of the function and make it available everywhere:

if (!function_exists('set_magic_quotes_runtime')) {
    function set_magic_quotes_runtime($new_setting) {
        return true;
    }
}

You are using PHP version 7.x.x, at which set_magic_quotes_runtime() was removed.

This function was DEPRECATED in PHP 5.3.0, and REMOVED as of PHP 7.0.0.

Related