location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_buffers 8 8k;
fastcgi_buffer_size 8k;
}
后两条一定要加上,否则会报请求的页面过大之类的
重启nginx
service nginx restart
然后设置php时区,
cd /usr/local/nginx/html/cacti/vi include/global_constants.php
如果不写时区的话,会在访问cacti的页面上出现日志
It is not safe to rely on the system's timezone settings
在写php程序中有时会出现这样的警告: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 'UTC' for '8.0/no DST' instead in D:\PHPWEB\news\file.php on line 17 。
这是因为PHP所取的时间是格林威治标准时间,所以和你当地的时间会有出入格林威治标准时间和北京时间大概差8个小时左右,我们可以按照下面的方法解决:
1、在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即<?phpdate_default_timezone_set("PRC");?>就可以了。
2、在php.ini中设置date.timezone的值为PRC,设置好以后的为:date.timezone=PRC,同时取消这一行代码的注释,即去掉前面的分号就可以了。
接下来配置snmp,编辑/etc/snmp/snmpd.conf
vi /etc/snmp/snmpd.conf
然后找到41行将public改成一个较为复杂的名字:
com2sec notConfigUser default public
然后找到62行
access notConfigGroup "" any noauth exact systemview none none
将systemview改成all:
access notConfigGroup "" any noauth exact all none none
然后去掉85行的注释:
view all included .1 80
保存配置文件后启动snmp
service snmpd start
时区的问题解决了,可是出现了令一个bug:
Error
The following PHP extensions are missing:
* sockets
Please install those PHP extensions and retry