安裝完php php-fpm nginx 後訪問php出現file not found錯誤,html就沒問題配置文件server 段以下 php
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指令配置錯誤有關,可是這裏並無錯誤。 html
後來發現,php-fpm進程user 是apache,nginx work進程user是www。不一致致使的把php-fpm的啓動user改爲www,就行了 nginx