关于搭建LEMP环境的一点疑问
高洛峰
高洛峰 2016-10-27 11:27:08
0
1
678

在ubuntu 12.04版本下搭建LEMP环境,参照网上教程配置一步步下来,发现访问index.php一直报404 NOT FOUND 的错误(如果将文件名改回index.html则可以正常访问),请问该如何解决?
php相关配置文件中已经设置了cgi.fix_pathinfo=0和listen = /var/run/php5-fpm.sock
nginx配置信息如下:

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;
    }
}


高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!