找回密码
 新建账号

[PHP] Call to undefined function set_magic_quotes_runtime()

[复制链接]
php 发表于 2015/12/12 04:43 | 显示全部楼层 |阅读模式
Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in D:\Web\bbs\install\index.php:12 Stack trace: #0 {main} thrown in D:\Web\bbs\install\index.php on line 12

安装Discuz时出现以上错误,是因为从PHP 5.4开始,set_magic_quotes_runtime()已经被弃用,从PHP 7.0开始set_magic_quotes_runtime()已经被移除,该函数已经不再是PHP内置函数,该函数被弃用并移除是因为magic quotes这一功能被弃用或移除,magic quotes,即魔术引号功能,是PHP 5.3及更早版本中用于自动转义双引号、单引号、反斜线和null特殊字符的

如果在PHP 5.4 - PHP 5.6中调用set_magic_quotes_runtime(),并且没有关闭错误显示,则会报以下错误。

Deprecated: Function set_magic_quotes_runtime() is deprecated in D:\Web\bbs\install\index.php on line 12

Fatal error: set_magic_quotes_runtime(): magic_quotes_runtime is not supported anymore in Unknown on line 0

解决方法:直接将调用函数的代码删除即可,在不支持魔术引号的版本中,即使能够调用函数,调用函数进行的设置也不会生效,而get_magic_quotes_gpc()和get_magic_quotes_runtime()永远返回false.

对于 Discuz! X3.2,即删除install/index.php第12行的以下代码
  1. @set_magic_quotes_runtime(0);
复制代码

手机版|轻松E站

GMT+8, 2024/4/20 16:36

快速回复 返回顶部 返回列表