修正memcache.php中的错误示例
使用memcache.php监控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 line736
根据提示可以列出memecache.php相关的行数内容;
24define('DATE_FORMAT','Y/m/dH:i:s');
736echo'<trclass=tr-0><tdclass=td-0>StartTime</td><td>',date(DATE_FORMAT,$memcacheStatsSingle[$server]['STAT']['time']-$memcacheStatsSingle[$server]['STAT']['uptime']),'</td></tr>';
解决办法:
24define('DATE_FORMAT','Y/m/dH:i:s');
之上增加一行
date_default_timezone_set("PRC");
其他方法,例如在php.ini中设置date.timezone的值,无论怎么设置和重启PHP-FPM进程都不生效,这点比较奇怪;
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。