php 调用未定义的函数 set_magic_quotes_runtime()

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46630924/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 03:14:18  来源:igfitidea点击:

Call to undefined function set_magic_quotes_runtime()

php

提问by John Cena

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?

有人知道这是什么意思吗?

回答by Lajos Arpad

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 functioncall 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 functionand make it available everywhere:

该函数不再存在于 PHP 7 中,也不再存在于它所使用的设置,因此您需要删除它的用法。您需要保存代码的当前状态并尝试删除此function调用的所有实例,然后查看该站点是否正在运行,如果是,则它是否按您预期的那样运行。或者,您可以实现 的虚拟版本function并使其随处可用:

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

回答by Hossam

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

您使用的是 PHP 版本 7.xx,在该版本中set_magic_quotes_runtime()已被删除

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

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