ecshop安裝問題總結

今天安裝個ecshop2.7.2,除了這個版本有漏洞可以復現外,主要還是想測試下cheetah這個工具,但是發現ecshop安裝真煩心,挺多問題的,就掛篇問題總結。一般PHP 5.3版本以上會出現比較多的錯誤。

新浪微博同步:http://blog.sina.com.cn/laomacanhu

1.Strict Standards: Non-static method cls_image::gd_version() should not be called statically in  ..\..\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.檢測環境的時候提示:是否支持 JPEG是不支持的。


       查看發現有libjpeg.lib庫,GD2庫也有,都加載了,也都正常。查看ecshop源代碼發現install/includes/lib_installer.php中第100行,JPEG寫成了JPG,正確的應該是:
$jpeg_enabled = ($gd_info['JPEG Support'] === true) ? $_LANG['support'] : $_LANG['not_support'];
打印數組$gd_info的時候,裏面的鍵名是:JPEG Support。而$gd_info數組裏的值都是直接調用系統環境變量的。

3.默認時區問題:Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in ..\..\ecshop\install\includes\lib_installer.php on line 225


(1)將php.ini裏是date.timezone前的";"去掉,改成:date.timezone = PRC;

(2)或者在首句寫入 ini_set('date.timezone','Asia/Shanghai');

(3)或者在頁頭使用date_default_timezone_set()設置 date_default_timezone_set('PRC'); //東八時區 echo date('Y-m-d H:i:s');

4. ecshop的時候最上面出現了一個錯誤提示:Strict Standards: Only variables should be passed by reference in ..\cls_template.php on line 418

        打開cls_template.php文件中發現下面這段代碼:$tag_sel = array_shift(explode(' ', $tag));PHP5.3以上默認只能傳遞具體的變量,而不能通過函數返回值傳遞,explode就得重新賦值,替換成下列代碼:

$tagArr = explode(' ', $tag);
        $tag_sel = array_shift($tagArr);
        原先的報錯就消失,但是返回upload左側和底部還有報錯,還需要去ecshop的後臺點擊清除緩存,重新載入才能去除。

 

5. ECShop安裝之後,在後臺發現一個錯誤提示:
        Strict Standards: mktime(): You should be using the time() function instead in ..\..\admin\shop_config.php on line 32

        這個錯誤提示的意思:mktime()方法不帶參數被調用時,會被拋出一個報錯提示。
        找到文件第32行:$auth = mktime();
        將mktime()替換成time()方法,代碼爲:$auth = time();

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章