安装ecshop默认安装后的错误解决方案

1,统一解决
php.ini中的配置 error_reporting = E_ALL | E_STRICT
这是说,显示那些不符合编码规范的警告(coding standards warnings)。
建议取消error的输出,如果出于调试需要,应改为
error_reporting = E_ALL & ~E_NOTICE

2.首页出现报错:Only variables should be passed by referen
找到出错行(includescls_template.php 文件的418行)
$tag_sel = array_shift(explode(‘ ‘, $tag));
改成:
$tag_bak = explode(‘ ‘, $tag);
$tag_sel = array_shift($tag_bak);
因为array_shift的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值,后台更新缓存后正常。
另一个地方同样修改(includeslib_main.php”文件的1329行):
//$ext = end(explode(‘.’, $tmp));
$ext_bak = explode(‘.’, $tmp);
$ext = end($ext_bak);

 

3.Strict Standards: Non-static method cls_image::gd_version() should not be called statically
找到出错行(includeslib_base.php”文件的346行)
return cls_image::gd_version();
改成:
$p = new cls_image();
return $p->gd_version();
是因为gd_version()方法未声明静态static,所以会出错。

 

4. Strict standards: mktime(): You should be using the time() function instead
错误行:$auth = mktime();
PHP手册里http://cn2.php.net/manual/en/function.mktime.php有个Note:
As of PHP 5.1, when called with no arguments, mktime() throws an E_STRICT notice: use the time() function instead.
自从PHP5.1起,调用这个函数不传递参数,会出现一个 notice

批量替换mktime()为@mktime()即可

你可能感兴趣的:(ecshop)