lnmp打开cacti时提示PHP Warning: date()

配置完lnmp后,配置cacti,打开时发现,显示网页,手动运行   /usr/local/php/bin/php  /usr/local/nginx/html/cacti/poller.php  --force时提示

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/nginx/html/cacti/cmd.php on line 61

这个提示是php.ini没有配置好时区,这时可以在php.ini里设置date.timezone= PRC或者date.timezone=Asia/Chongqing,然后重启php-fpm,但要确定你的php.ini是编译时安装指定的配置文件,如果不是,相当于白忙一场,之前在用cacti-plugin-0.8.7h的时候,在登陆页面输入密码后跳转到cacti/install/index.php后,页面是空白的,可能是版本有问题,换新版本后cacti-spine-0.8.8b,却是有上面的提示,修改php.ini配置文件后还是无法搞定,打开cacti后发现,console可以显示,但graphs却出不了图,显示都是提示类似上面的东西,打开include/global_constants.php,在非php注释的行最前面添加一行date_default_timezone_set(‘PRC’);,这时就可以正常出图了

原文地址:https://www.cnblogs.com/2myroad/p/3849155.html