安装ecshop 常见的 Strict Standards: array_shift()和Deprecated: preg_replace():

1. 错误信息:Strict Standards: Only variables should be passed by reference inD:\xampp\htdocs\web\shop\includes\cls_template.phpon line 418

解决方法:

找到文件:\includes\cls_template.php

错误代码:

$tag_sel = array_shift(explode(' ', $tag));

替换为: 

$tag_arr = explode(' ', $tag);
$tag_sel = array_shift($tag_arr);



2. 错误信息:Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead inD:\xampp\htdocs\web\shop\includes\cls_template.php on line 548

解决方法:

找到文件:\includes\cls_template.php

错误代码:

$val = preg_replace("/\[([^\[\]]*)\]/eis", "'.'.str_replace('$','\$','\\1')", $val);

替换为:

$val = preg_replace_callback("/\[([^\[\]]*)\]/is", function ($matches) { return '.'.str_replace('$','\$',$matches[1]);}, $val);


3. 错误信息:Strict Standards: mktime(): You should be using the time() function instead in D:\xampp\htdocs\web\shop\admin\sms_url.php on line 31

解决方法:

找到文件:\admin\sms_url.php 

错误代码:

$auth = mktime();

替换为:

$auth = time();

4. 错误信息:Strict Standards: mktime(): You should be using the time() function instead in D:\xampp\htdocs\web\shop\admin\shop_config.php on line 32

解决方法:

找到文件:\admin\shop_config.php 

错误代码:

<pre name="code" class="php">$auth = mktime();
 

替换为:

$auth = time();


5. 错误信息:Strict Standards: Redefining already defined constructor for class alipay in D:\xampp\htdocs\web\shop\includes\modules\payment\alipay.php on line 88


错误原因:PHP 类,有两种构造函数,一种是跟类同名的函数,一种是 __c**truct()。从PHP5.4开始,对这两个函数出现的顺序做了最严格的定义,必须是 __c**truct() 在前,同名函数在后

解决方法:

找到文件:\includes\modules\payment\alipay.php

错误代码:


function alipay()
    {
    }

    function __construct()
    {
        $this->alipay();
    }

替换为:

替换两个函数的位置

function __construct()
{
    $this->alipay();
}
function alipay()
{
}













替换为:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值