修正memcache.php中的错误示例
使用memcache.php監(jiān)控memcache后,在頁面報時間格式的錯誤:
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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in/usr/local/nginx/html/memcache.phpon line?736
根據(jù)提示可以列出memecache.php相關(guān)的行數(shù)內(nèi)容;
| 1 | 24?define('DATE_FORMAT','Y/m/d?H:i:s'); |
| 1 | 736?echo?'<tr?class=tr-0><td?class=td-0>Start?Time</td><td>',date(DATE_FORMAT,$memcacheStatsSingle[$server]['STAT']['time']-$memcacheStatsSingle[$server]['STAT']['uptime']),'</td></tr>'; |
解決辦法:
| 1 | 24?define('DATE_FORMAT','Y/m/d?H:i:s'); |
之上增加一行
date_default_timezone_set("PRC");
其他方法,例如在php.ini中設(shè)置date.timezone的值,無論怎么設(shè)置和重啟PHP-FPM進(jìn)程都不生效,這點(diǎn)比較奇怪;
本文轉(zhuǎn)自 bannerpei 51CTO博客,原文鏈接:http://blog.51cto.com/281816327/1622008,如需轉(zhuǎn)載請自行聯(lián)系原作者
總結(jié)
以上是生活随笔為你收集整理的修正memcache.php中的错误示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: LInux实践笔记
- 下一篇: rabbitmq php 学习