在做zabbix监控时发现访问zabbix主页 报错为
File not found
经过查询资料是因为,php-fpm 未找到php文件
如果没有安装php-fpm则先安装:
yum -y install php-fpm
若已安装则检查 nginx 配置文件
vim /etc/nginx/nginx.conf
找到此段:
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
# fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/scripts$fastcgi_script_name;
include fastcgi_params;
将
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/scripts$fastcgi_script_name;
改为
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;