在安裝Ecshop的時候,遇到兩個問題:
一、Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:Xwwwecshopinstallincludeslib_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,所以會出錯。這時候只要:
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();
二、檢測環(huán)境的時候提示:是否支持 JPEG是不支持的。
解決:查看發(fā)現(xiàn)有l(wèi)ibjpeg.lib庫,GD2庫也有,都加載了,也都正常。查看ecshop源代碼發(fā)現(xiàn)install/includes/lib_installer.php中 00行,JPEG寫成了JPG,正確的應(yīng)該是:
$jpeg_enabled = ($gd_info['JPEG Support'] === true) ? $_LANG['support'] : $_LANG['not_support'];
為何說Ecshop寫錯了,因為我打印數(shù)組$gd_info的時候,里面的鍵名是:JPEG Support。而$gd_info數(shù)組里的值都是直接調(diào)用系統(tǒng)環(huán)境變量的。
三、默認時區(qū)問題:
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 D:Xwwwecshopinstallincludeslib_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()設(shè)置 date_default_timezone_set('PRC'); //東八時區(qū) echo date('Y-m-d H:i:s');