首页 > 代码库 > PHP5.5下安装配置EcShop
PHP5.5下安装配置EcShop
建议用较旧的PHP版本与EcShop搭配,比如PHP5.3,新版的PHP有很多奇奇怪怪的问题。。。
错误描述:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in D:\xampp\htdocs\ECShop\upload\includes\cls_template.php on line 300
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in D:\xampp\htdocs\ECShop\upload\includes\cls_template.php on line 557
错误原因:
preg_replace用到的修饰符/e在php5.5已经被废弃
解决方法:
将上述语句替换成:return preg_replace_callback("/{([^\}\{\n]*)}/", function($r){return $this->select($r[1]);}, $source);
---------------------------------------------------------------------------------------------
错误描述:
Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:\xampp\htdocs\ECShop\upload\includes\lib_base.php on line 346
错误原因:
“::”调用的方法必须是static的静态方法,而原有的cls_image类的gd_version()方法缺少这个关键字。
解决方法:
两种方法任选其一:
1、将cls_image类的gd_version()前增加static,即:static function gd_version();
2、先创建cls_image类的实例,再调用gd_version()
$p = new cls_image();
//return $p->gd_version();
---------------------------------------------------------------------------------------------
错误描述:
Strict Standards: Only variables should be passed by reference in D:\xampp\htdocs\ECShop\upload\includes\cls_template.php on line 424
错误原因:
中文意思为:“传入的变量只能为引用变量”。array_shift这个函数的参数是引用传递的,php5.3以上默认只能传递具体的变量,而不能通过函数返回值来传递。
解决方法:
$tag_sel = array_shift(explode(‘ ‘, $tag));
改成:
$tag_arr = explode(‘ ‘, $tag);
$tag_sel = array_shift($tag_arr);
然后删除工程目录下的temp文件夹,重新拷贝一份原始的temp文件夹进来,再访问首页,就会发现一切正常了!
---------------------------------------------------------------------------------------------
错误描述:
Strict Standards: mktime(): You should be using the time() function instead in D:\xampp\htdocs\ECShop\upload\admin\shop_config.php on line 32
Strict Standards: mktime(): You should be using the time() function instead in D:\xampp\htdocs\ECShop\upload\admin\sms_url.php on line 31
错误原因:
PHP5.1版后调用mktime()不带参数,会弹出这个违反标准的通知。如果要不带参数调用mktime,等同于调用time(),应用其代替。
解决方法:
打开对应的文件,将
$auth = mktime();
更改为:
$auth = time();
---------------------------------------------------------------------------------------------
PHP5.5下安装配置EcShop