天天看點

安裝vmall5:從ebak恢複資料,需要配置php.ini

上傳vmall5源碼到伺服器後通路ebak目錄,發現網頁不顯示。用xshell登入到伺服器手動執行ebak/index.php檢視輸出,發現這樣一個錯誤:

PHP Parse Error: syntax error, unexpected $end ,blablabla...

這是因為php沒有開啟短标簽。在php.ini中找到并設定:

short_open_tag = On

另一個錯誤,直接php解釋執行根目錄的index.php發現說資料庫沒有指定。那就到報錯的檔案,手動指定:

vim /var/www/html/app.hzyuanjian.cn/app/frontend.base.php +565 $mod->db->query('use my_database');

第三個錯誤是時區問題。依然執行根目錄的index.php,提示說

PHP Warning: date(): 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 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /var/www/html/xxxxxx/eccore/controller/message.base.php on line 180

解決辦法:依舊是修改php.ini,找到并修改為:

date.timezone = "Asia/Shanghai"

然後,重新開機httpd程序:

service httpd restart