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排錯] Forbidden You don't have permission to access / on this server.PHPORBServer
- You don't know CSSCSS
- php artisan serve 等同於 php -S localhost:8000 -t ./publicPHPlocalhost
- You don't know css(2)CSS
- You Buy a NUMA System, Oracle Says Disable NUMAOracle
- fuse: mountpoint is not empty fuse: if you are sure this is safe, use the ‘nonempty‘ mount optionNone
- MySQL日誌警告'[Warning] Unsafe statement written to the binary log'MySql
- 網站提示:You Don’t Have Permission To Access網站
- Couldn't be opened because you don't have permission to view it 執行時報錯View
- AT&T has not set cheap wow gold an end dateGo
- You can‘t specify target table ‘Person‘ for update in FROM clause
- You don't have write permissions for the /usr/bin directory.
- k8s中ConfigMap的timezone使用K8S
- WARNING: Heavy swapping observed on system in last 5 minsAPPAST
- ORA-12504 warning in PHPPHP
- mysql中You can’t specify target table for update in FROM clMySql
- wamp出現You don’t have permission to access/on this server提示Server
- Unable to convert MySQL date/time value to System.DateTimeMySql
- Access denied; you need (at least one of) the PROCESS privilege(s)AST
- JavaScript’s “this”: how it works, where it can trip you upJavaScript
- WARNING: Heavy swapping observed on system in last 5 mins.APPAST
- flutter升級後 執行專案報錯 Warning: Podfile is out of dateFlutter
- PHP date() 函式遇到的坑PHP函式
- 2007.12.17:see to it that the door is locked safely before you goGo
- I can't truly give chinese sex pills you a conclusive remedyREM
- 2008 5 19: I can't make exception for youException
- PHP Warning:fopen出錯如何解決?PHP
- 關於【s】和[t]字元字元
- PHP中關於date("Y-m-d H:i:s")慢8小時的解決PHP
- PHP5.2.6(error_log)safe_modeBypassVulnerabilityPHPError
- WARNING: The 32 bit library file libstdc++.so.6 is not found on the systemC++
- Starting MySQL * Couldn't find MySQL server (/usr/bin/mysqld_safe)MySqlServer
- Oracle TimezoneOracle
- System Administration Assistant[t-code]SSAA
- A temporary profile is loaded after you log on to a Windows Vista-based systemWindows
- [AlwaysOn] T-SQL語法:REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT引數SQLUIsynchronizedMIT
- php's portPHP