PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* t
[Wed Mar 23 17:20:56 2016] [error] [client 10.30.8.40] 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 /opt/uploads/discuz2.5/app/post_list.php on line 31
1、在頁頭使用date_default_timezone_set()設定我的預設時區為北京時間,即 <?php date_default_timezone_set("PRC"); ?>就可以了。
2、在php.ini中設定date.timezone的值為PRC,設定好以後的為:date.timezone=PRC或者date.timezone = Asia/Shanghai,同時取消這一行程式碼的註釋,即去掉前面的分號就可以了。
然後重啟apache即可!
相關文章
- BUG: JS 修改Date的TimezoneJS
- php artisan serve 等同於 php -S localhost:8000 -t ./publicPHPlocalhost
- You don't know CSSCSS
- fuse: mountpoint is not empty fuse: if you are sure this is safe, use the ‘nonempty‘ mount optionNone
- WARNING: Heavy swapping observed on system in last 5 minsAPPAST
- You don't know css(2)CSS
- k8s中ConfigMap的timezone使用K8S
- 網站提示:You Don’t Have Permission To Access網站
- linux timezoneLinux
- flutter升級後 執行專案報錯 Warning: Podfile is out of dateFlutter
- PHP Warning:fopen出錯如何解決?PHP
- FILESTREAM feature can't be enabled if you use cluster shared volumes
- You don't have write permissions for the /usr/bin directory.
- You can‘t specify target table ‘Person‘ for update in FROM clause
- Moment.js遇到Deprecation warning: moment construction falls back to js Date 解決方法JSStruct
- PHP date() 函式遇到的坑PHP函式
- mysql中You can’t specify target table for update in FROM clMySql
- PHP中關於date("Y-m-d H:i:s")慢8小時的解決PHP
- [AlwaysOn] T-SQL語法:REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT引數SQLUIsynchronizedMIT
- Try to run this command from the system terminal. Make sure that you use the correct version of ‘...
- S2 - Lesson 57 - Can I help you, madam?
- 關於【s】和[t]字元字元
- MIT 6.S081 Lab File SystemMIT
- 【java】Maths類、Random類、System類、BigInteger類、BigDecimal類、Date類、SimpleDateFormat類JavarandomDecimalORM
- Composer 建立專案 You can also run `PHP --INI`PHP
- PHP exec system passthru系統函式PHP函式
- pbootcms模板報錯提示PHP Warning: Unknown: open_basedir restrictionbootPHPREST
- UE5 打包安卓後出現permission required you must approve this premission in app settings: storage彈窗安卓UIAPPREM
- Java基礎Day07(Map Calender Date 包裝類 System類 異常)Java
- PHP Warning: exec() has been disabled for security 問題解決辦法PHP
- MIT6.S081 - Lab2: system callsMIT
- EOCR-DS3T-60S/EOCRDS3T-60S施耐德電機保護繼電器S3
- S01E01-Buddy, Why do you keep getting stuck like this
- safe-point(safepoint 安全點) 和 safe-region(安全區域)
- Attention isn’t all you need!BERT的力量之源遠不止注意力
- T113s工業套件簡述套件
- Unable to save settings: Failed to save settings. Please restart PyCharm解決AIRESTPyCharm
- Are you sure you understand the responsive layout?
- SAFe不是敏捷 - Jeff Gothelf敏捷Go