ECShop 开源系统安装报错修改

为了研究ECShop的系统使用。安装了一个网店系统,结果装完一堆报错。大脑凌乱了。百度一下,网上一搜一大片,为了以后更好的解决问题,开个文章记录一下,便于下次修改。


cls_template.php的493行

$out = “<?php \n” . ‘$k = ‘ . preg_replace(“/(\’\\$[^,]+)/e” , “stripslashes(trim(‘\\1’,’\”));”, var_export($t, true)) . “;\n”;

换成:

$out = <?php \n” . ‘$k = ‘ . preg_replace_callback(“/(\’\\$[^,]+)/” , function($r) {return stripslashes(trim($r[1],’\”));}, var_export($t, true)) . “;\n”;


将cls_template.php的552行

$val = preg_replace(“/\[([^\[\]]*)\]/eis”, “‘.’.str_replace(‘$’,’\$’,’\\1′)”, $val);

换成:

$val = preg_replace_callback(“/\[([^\[\]]*)\]/”, function($r) {return ‘.’.str_replace(‘$’,’$’,$r[1]);}, $val);


1.Parse error: syntax error, unexpected ‘row’ (T_STRING) in /var/www/buy4girl_com/temp/compiled/admin/pagefooter.htm.php on line 108

 


2.Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in /var/www/buy4girl_com/includes/cls_template.php on line 1075

$pattern = ‘/<!–\s#BeginLibraryItem\s\”\/(.*?)\”\s–>.*?<!–\s#EndLibraryItem\s–>/se’;
$replacement = “‘{include file=’.strtolower(‘\\1’). ‘}'”;
$source = preg_replace($pattern, $replacement, $source);

换成:

$pattern = ‘/<!–\s#BeginLibraryItem\s\”\/(.*?)\”\s–>.*?<!–\s#EndLibraryItem\s–>/s’;
$source = preg_replace_callback($pattern, function($r){return ‘{include file=’.strtolower($r[1]). ‘}’;}, $source);

3.

ecshop首页出现Strict standards: Only variables should be passed by reference in D:\wamp\www\includes\lib_main.php on line 1329这个错误。
includes\lib_main.php  第1329行  把$ext = end(explode(‘.’, $tmp));修改成 $tmp_arr=explode(‘.’, $tmp);$ext = end($tmp_arr);

—-
未完待续

此条目发表在程序小工具, 网站建设分类目录。将固定链接加入收藏夹。