PHP5.3后(set_magic_quotes_runtime(),ereg() )已经关闭。

运行php程序出现以下错误
Deprecated: Function set_magic_quotes_runtime() is deprecated


导致这个提示的原因是在PHP5.3后此特性(set_magic_quotes_runtime())已经关闭。
而且在PHP6中已经完全移除此特性。
你可以注释或者删除掉出错的行,或者是在set_magic_quotes_runtime()前面加@符号。


PHP 5.3 ereg() 无法正常使用,提示“Function ereg() is deprecated Error”。问题根源是php中有两种正则表示方法,一个是posix,一个是perl,php6打算废除posix的正则表示方法所以后来就加了个 preg_match。此问题解决办法很简单,在ereg前加个过滤提示信息符号即可:把ereg()变成@ereg()。这样屏蔽了提示信息,但根本问 题还是没有解决,php在5.2版本以前ereg都使用正常,在5.3以后,就要用preg_match来代替ereg。所以就需要变成这样,原来:

ereg ( " ^[0-9]*$ " , $page )

变成:

preg_match ( " /^[0-9]*$/ " , $page )

特别提醒:posix与perl的很明显的表达区别就是是否加斜杠,所以与ereg相比,后者在正则的前后分别增加了两个”/”符号,不能 缺少。
Tips:此问题在php5.2之前版本不会出现。

Function ereg() is deprecated in drupal-6.15\includes\file.inc on line 904
open the file.inc in a good text editor other than notepad, go to the line number 904 to see the following line. Then comment the line and in the next line type the replaced code. this will solve the instalation issues and also most of other issues related to the same issue.

Change

elseif ($depth >= $min_depth && ereg($mask, $file)) {

to
elseif ($depth >= $min_depth && mb_ereg($mask, $file)) {

mb_ereg fortunatly is not deprecated

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值