在ubuntu 12.04版本下搭建LEMP環境,參考網路教學設定一步步下來,發現存取index.php一直報404 NOT FOUND 的錯誤(如果將檔案名稱改回index.html則可以正常存取),請問該如何解決?
php相關設定檔中已經設定了cgi.fix_pathinfo=0和listen = /var/run/php5-fpm.sock
nginx設定資訊如下:
<code>server { listen 80; root /vagrant/www/; index index.php index.html index.htm; server_name localhost; error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/www; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }</code>