不少朋友發(fā)現(xiàn)ecshop在php高版本的情況下 會(huì)出現(xiàn)報(bào)錯(cuò)
1、PHP 5.4.X環(huán)境下安裝ECShop出現(xiàn)“includes/cls_template.php on line 406”的解決方案。
將 $tag_sel = array_shift(explode(‘ ‘, $tag)); 這句話拆開(kāi)為兩句。
$tag_arr = explode(‘ ‘, $tag);
$tag_sel = array_shift($tag_arr);
array_shift() 的參數(shù)是引用傳遞的,5.3以上默認(rèn)只能傳遞具體的變量,而不能通過(guò)函數(shù)返回值 end(&array) 也一樣(后面也會(huì)有end的函數(shù),也需要拆分為兩行)。
2、PHP 5.4.X環(huán)境下安裝ECShop出現(xiàn)“includes/lib_base.php on line 346”的解決方案。
將 cls_image.php 中 function gd_version() 改成 static function gd_version() 即可。
3、后臺(tái)點(diǎn)擊 開(kāi)店向?qū)?警告的解決方案。
admin/include/modules/payment 下的幾個(gè)文件構(gòu)造函數(shù)錯(cuò)誤,刪掉即可。
4、php5.4下安裝的時(shí)候處理問(wèn)題,Strict Standards: Non-static method cls_image::gd_version() should not be called statically in installincludeslib_installer.php on line 31
解決:找到install/includes/lib_installer.php中的第31行 return cls_image::gd_version();然后在找到include/cls_image.php中的678行,發(fā)現(xiàn)gd_version()方法未聲明靜態(tài)static,所以會(huì)出錯(cuò)。這時(shí)候只要:
將function gd_version()改成static function gd_version()即可。
5 安裝好后出現(xiàn) Strict standards: Only variables should be passed by reference in includeslib_main.php on line 1329
$ext = end(explode('.', $tmp));
修改為:
$ext = explode('.',$tmp);
$ext = end($ext);
Strict standards: Only variables should be passed by reference in includescls_template.php on line 418
tag_sel = array_shift(explode(' ', $tag));
修改為:
$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);