nginx file not found 错误处理小记

安装完php php-fpm nginx 后访问php出现file not found错误,html就没问题配置文件server 段如下

复制代码
server {
        listen       80; 
        server_name  192.168.1.11;
        root  /home/www;


        location ~ .*.php$
        {   
            try_files $uri =404;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fcgi.conf;
        }   
 }   
复制代码

google一番,file not found错误与root指令配置错误有关,但是这里并没有错误。

后来发现,php-fpm进程user 是apache,nginx work进程user是www。不一致导致的把php-fpm的启动user改成www,就好了

原文地址:https://www.cnblogs.com/caicaizi/p/9377795.html