分类
编程

nginx访问php提示An error occurre

nginx.conf和配置好了,还是提示这个

原因是安装PHP后没有开启php-fpm服务,在命令窗口直接输入php-fpm启动,就好了,正常访问php文件

附上nginx的php配置

location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

其中php的9000端口默认需要修改