安装ECShop2.7.3出现了一堆问题,主要是因为PHP版本過高引起的,
使用PHP5.5.x,ECShop安装完成出現了下面提示,特别是在cls_template.php文件中。下面就将需要替换的部分一一替换。经常性出现这样的问题:Deprecated: preg_replace(): The /e modifier is deprecated,use preg_replace_callback instead.

查找:
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
替换为:
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);


查找:
$out = " 替换为:
$out = "

查找:
$val = preg_replace("/\[([^\[\]]*)\]/eis", "'.'.str_replace('$','\$','\\1')", $val);
替换为:
$val = preg_replace_callback("/\[([^\[\]]*)\]/is", function($ro) {return '.'.str_replace('$','\$',$ro[1]);}, $val);


查找:
$source = preg_replace($pattern, $replacement, $source);
替换为:
$pattern = '/.*?/s';
$source = preg_replace_callback($pattern, function($ro) {return '{include file='.strtolower($ro[1]). '}';}, $source);




還有 Non-static method cls_image::gd_version() should not be called statically

在 inlcudes/lib_base.php 也會出現錯誤

查找:
return cls_image::gd_version();
替換為
$p = new cls_image();
return $p->gd_version();



資料來源:
1. http://qiunile.com/90.html
2. http://www.cnblogs.com/thinksasa/archive/2013/03/12/2955922.html

peeress 發表在 痞客邦 PIXNET 留言(0) 人氣()