本机ECShop_V2.7.3_UTF8安装时报错
复制,转载,总结的
解决权限问题
chmod-R777
/usr/local/apache/htdocs/ecshop
Ecshop安装过程中的的问题:cls_image::gd_version()和不支持JPEG
在安装Ecshop的时候,遇到两个问题:1.Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:\X\www\ecshop\install\includes\lib_installer.php on line 31
解决:找到install/includes/lib_installer.php中的第31行 return cls_image::gd_version();然后在找到include/cls_image.php中的678行,发现gd_version()方法未声明静态static,所以会出错。这时候只要:
1)将function gd_version()改成static function gd_version()即可。
2)或者将install/includes/lib_installer.php中的第31行return cls_image::gd_version();改成:
$p = new cls_image();
return $p->gd_version();
2.
安装ecshop2.7.3,gd2库已经开启,png等图片格式也都支持,但是显示不支持jpeg,导致安装无法进行下去,ECSHOP网站开发中心官方查看检测的源文件install/includes/lib_installer.php.其中98行左右是对图片格式的验证。下面是官方技术提供的解决方法:
1 $gd_info = gd_info();
2 $jpeg_enabled = ($gd_info['JPG Support'] === true) ? $_LANG['support'] :$_LANG['not_support'];
3 $gif_enabled = ($gd_info['GIF Create Support'] === true) ? $_LANG['support'] :$_LANG['not_support'];
4 $png_enabled = ($gd_info['PNG Support'] === true) ? $_LANG['support'] :$_LANG['not_support'];
可用看到是对$gd_info值检验来看是否支持某个图片类型的,打印这个数组,可用看到其是支持JPEG的,$gd_info['JPEG Support']是存在的,$gd_info['JPG Support']不存在。所以将$gd_info['JPG Support'] 修改为$gd_info['JPEG Support']即可。
3.
问题一:商城首页报错 Strict Standards: Only variables should be passed by reference in D:\wamp\ecshop\includes\cls_template.php on line 422
解决方法:
找到提示错误的文件 cls_template.php 及行号
把 $tag_sel = array_shift(explode(' ', $tag));
改成:
$tag_arr = explode(' ', $tag);
$tag_sel = array_shift($tag_arr);
并且删除 D:\wamp\www\ecshop\temp\caches下所有的文件
4.
使用php5.5运行ecshop的时候出现如下错误Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in \ecshop\includes\cls_template.php on line 300
解决方法如下
打开ecshop的目录找到includes\cls_template.php 到第300行
把
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
替换成
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);
重新运行问题以解决
一、将 cls_template.php的300行
return preg_replace( "/{([^\}\{\n]*)}/e" , "\$this->select('\\1');" , $source );
|
换成:
return preg_replace_callback( "/{([^\}\{\n]*)}/" , function ( $r )
{ return $this ->select( $r [1]);
}, $source );
|
二、将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 );
|
四、将cls_template.php的1069行
$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 );
|
5.
Strict standards: mktime(): You should be using the time() function instead in D:\wamp\wamp\www\ECShop\upload\admin\sms_url.php on line 31 错误的解决方法:
ECShop安装之后,在后台发现一个错误提示:
Strict standards: mktime(): You should be using the time() function instead in D:\wamp\wamp\www\ECShop\upload\admin\sms_url.php on line 31
这个错误提示的意思:mktime()方法不带参数被调用时,会被抛出一个报错提示。
按照路径 D:\wamp\wamp\www\ECShop\upload\admin\sms_url.php 找到文件第31行:
$auth = mktime();
将mktime()替换成time()方法,代码为:
$auth = time();
6.
ECSHOP生成站点地图提示”Deprecated: Assigning the return value of new by reference is deprecated in…”。
定位到报错行
PHP5.3+废除了”=&”符号,对象复制用”=”即可,详细如下:
- PHP5对象复制是采用引用的方式。
- 如果不采用引用方式,则需要在复制对象时加关键字 clone。
- 如果在复制的过程中,同时要变更某些属性,则增加函数_clone()。
解决办法:搜索所有PHP文件,将”=&”替换为”=”。
7.
Strict Standards: Redefining already defined constructor for class alipay in /data/web/includes/modules/payment/alipay.php on line 85
这样的报错有很多,基本格式是:
Strict Standards: Redefining already defined constructor for class后面加路径。
这个问题是PHP高低版本中,对于类的构造函数写法不一样造成的。
在PHP4中,类的构造函数是一个和类名同名的函数作为构造函数的,
而在PHP5以后,用__construct()作为构造函数,但同时也支持PHP4中用类同名的构造函数方法,
同时使用的时候,请注意 同名函数不能放在__construct()构造函数前面。
下面以这个报错为例
Strict Standards: Redefining already defined constructor for class alipay in /data/web/includes/modules/payment/alipay.php on line 85
找到文件alipay.php
使用编辑器打开,找到下面的构造函数
将
放到
前面。
如上述方法将所有的构造函数放到前面问题就能得到解决。
8
Declaration of phpbb::set_cookie() should be compatible with integrate::set_cookie...
解决办法:把function set_cookie ($username="") 改为function set_cookie ($username="", $remember = NULL)即可