安装ecshop 常见的 Strict Standards: array_shift()和Deprecated: preg_replace():
1. 错误信息:Strict Standards: Only variables should be passed by reference inD:xampphtdocswebshopincludescls_template.phpon line 418
解决方法:
找到文件:includescls_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:xampphtdocswebshopincludescls_template.php on line 548
解决方法:
找到文件:includescls_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:xampphtdocswebshopadminsms_url.php on line 31
解决方法:
找到文件:adminsms_url.php
错误代码:
$auth = mktime();
替换为:
$auth = time();
4. 错误信息:Strict Standards: mktime(): You should be using the time() function instead in D:xampphtdocswebshopadminshop_config.php on line 32
解决方法:
找到文件:adminshop_config.php
错误代码:
<pre name="code" class="php">$auth = mktime();
替换为:
$auth = time();
5. 错误信息:Strict Standards: Redefining already defined constructor for class alipay in D:xampphtdocswebshopincludesmodulespaymentalipay.php on line 88
错误原因:PHP 类,有两种构造函数,一种是跟类同名的函数,一种是 __c**truct()。从PHP5.4开始,对这两个函数出现的顺序做了最严格的定义,必须是 __c**truct() 在前,同名函数在后
解决方法:
找到文件:includesmodulespaymentalipay.php
错误代码:
function alipay() { } function __construct() { $this->alipay(); }
替换为:
替换两个函数的位置
function __construct() { $this->alipay(); } function alipay() { }
替换为:
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: php的array_shift
- 下一篇: TP3.2 数据排序