PHP Deprecated: Directive 'magic_quotes_gpc' is deprecated 解决办法
来源:互联网 发布:java面向对象50选择题 编辑:程序博客网 时间:2024/04/28 22:01
apache 报错
PHP Deprecated: Directive 'magic_quotes_gpc' is deprecated
解决办法
去官方看了下,用红色的block特别注明了,php5.3已经不推荐使用这个东东了,在 PHP6 中已经将其废弃:
magic_quotes_gpc boolean
Warning
This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.
magic_quotes_gpc=on 的配置下,插入数据时,Magic quotes 会自动将数据转义。 可以从一定程度上,让初学者带离脚本的安全风险。例如在没有任何保护措施的代码下,开启了 Magic quotes 后会少很多的风险,例如注入问题。以前看一些安全方面的文章,入侵者总是喜欢选择magic_quotes_gpc=off的站下手,如果看到其 magic_quotes_gpc=on ,估计就不会弄这个站了。
那么官方为什么要废除这个东东呢?搜索了一下,看到一个写得相当详细和全面的帖子,下面将其中提到的几个原因帖出:
为什么不使用 Magic quotes:
可移植性
无论此功能是否开启,它都会影响脚本的可移植性,因为它影响我们后续过滤数据的操作。
性能问题
在获取所有的外部数据之前都会被转义,这无疑会增加运行时的花销(而且并不是所有的数据都需要转义)。
造成困惑
正如上述所言,并非所有的数据都需要被转义。有可能出现的一种情况,就是当你为了获取未被转义的数据,而“疯狂的”使用 stripslashes 函数。
如何禁用 magic_quotes_gpc 和safe_mode :
1,用 php.ini 配置文件全局禁用
1
2
magic_quotes_gpc = Off
safe_mode = Off
- PHP Deprecated: Directive 'magic_quotes_gpc' is deprecated 解决办法
- PHP:错误 Deprecated: Function split() is deprecated in ... 解决办法
- php中“Deprecated: Function split() is deprecated in”错误解决办法
- php Function split() is deprecated 的解决办法
- Deprecated: Function split() is deprecated in ... 解决办法
- PHP:Deprecated: Function set_magic_quotes_runtime() is deprecated 错误
- 【php】Deprecated: Function ereg() is deprecated in
- PHP显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
- PHP显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
- PHP显示Deprecated: Assigning the return value of new by reference is deprecated in解决办法
- 'dispath_get_current_queue'is deprecated:fist deprecated in iOS 6.0的解决办法
- PHP问题:Deprecated: Function split() is deprecated in解决方法
- php 报错Deprecated: Assigning the return value of new by reference is deprecated in的解决办法
- Deprecated: Function set_magic_quotes_runtime() is deprecated
- Deprecated: Function session_register() is deprecated
- Deprecated: Function xxx() is deprecated
- Deprecated: Function session_register() is deprecated
- Deprecated: Function session_register() is deprecated
- Ext加载地图控件
- ORA-00600 [kfgFinalize_2]的解决办法
- HPUX 大文件系统扩容
- 【数据结构】线性表链式存储_LinkList
- Python学习笔记
- PHP Deprecated: Directive 'magic_quotes_gpc' is deprecated 解决办法
- ExtJs.ajax.request请求参数为空的解决办法
- emacs ido mode 命令
- 微软失落的十年:官僚主义拖累科技巨头
- error:Injection of autowired dependencies failed
- SharePoint 2010 匿名用户调用Client Object Model访问列表项
- 【数据结构】静态链表_StaticLinkList
- ExtJs.ajax.request的异步请求
- java后台进程和线程优先级