ECSHOP程序安裝過程遇到數(shù)據(jù)庫失敗date_default_timezone_get()問題
發(fā)現(xiàn)各別國外空間再安裝ECSHOP時(shí)遇到的問題,以全新向?qū)J桨惭b時(shí)遇到具體的PHP警告如下:
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 ‘UTC’ for ’8.0/no DST’ instead in C:wwwrootincludeslib_installer.php on line 223
以上提示是說明由于PHP默認(rèn)的時(shí)間區(qū)域設(shè)置問題導(dǎo)致的警告,導(dǎo)致數(shù)據(jù)庫那段過不去而無法完成安裝,我門提供兩種解決辦法如下:
1. 修改includeslib_installer.php文件,在這個(gè)文件頂部<?php之內(nèi)加上如下PHP代碼:
date_default_timezone_set ('Asia/Shanghai');
這個(gè)是臨時(shí)的解決辦法,可以幫你成功安裝數(shù)據(jù)庫,長久之計(jì)還是要采用方法2。
2. 修改服務(wù)器的PHP配置文件。
打開PHP.INI文件搜索到; date.timezone = 去掉前面的注釋;號(hào),然后改成date.timezone =Asia/Shanghai,保存配置文件,重啟你的服務(wù)器。