首頁  >  文章  >  後端開發  >  關於搭建LEMP環境的一點疑問

關於搭建LEMP環境的一點疑問

WBOY
WBOY原創
2016-09-23 03:30:11800瀏覽

在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>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn