高版本PHP下搭建ECShop的问题整理

ECSshop版本2.7.3,PHP版本5.5.12,搭建时发现诸多报错,一一列举解决方法。

1.Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:wwwecshopinstallincludeslib_installer.php on line 31

lib_installer.php的31行调用了gd_version()函数,但是该函数未申明静态调用。

解决方法:
找到include/cls_image.php中的678行将 function gd_version() 改为 static function gd_version();

2.Strict Standards: Only variables should be passed by reference

解决方法:
找到\includes\cls_template.php 将 $tag_sel = array_shift(explode(' ', $tag)); 改为$tagArr = explode(' ', $tag);$tag_sel = array_shift($tagArr);

3.Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead

还是5.5版本PHP 所触发的问题。

解决方法:
`找到includescls_template.php 288行
return preg_replace("/{(1*)}/e", "$this->select('\\1');", $source);
改为
return preg_replace_callback("/{(2*)}/", function($r) { return $this->select($r[1]); }, $source);`


  1. }{n
  2. }{n
上一篇:[连载]《C#通讯(串口和网络)框架的设计与实现》- 13.中英文版本切换设计


下一篇:【Hadoop Summit Tokyo 2016】数据流与Apache NiFi