修正memcache.php中的错误示例

发布时间:2020-08-11 09:09:29 作者:StanlyCheng
来源:网络 阅读:657

使用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 line 736


根据提示可以列出memecache.php相关的行数内容;

24 define('DATE_FORMAT','Y/m/d H:i:s');
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>';

解决办法:

24 define('DATE_FORMAT','Y/m/d H:i:s');

之上增加一行

date_default_timezone_set("PRC");


其他方法,例如在php.ini中设置date.timezone的值,无论怎么设置和重启PHP-FPM进程都不生效,这点比较奇怪;



推荐阅读:
  1. 修正蹩脚的Scratch汉化
  2. 修正错误:在PHP打印当前页面的错误

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

php he

上一篇:ORACLE DataGuard 主备库角色切换

下一篇:Oracle服务端验证机制

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》