PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

关于搭建LEMP环境的一点疑问

原创
2016-09-23 03:30:11 620浏览

在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;
    }
}
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。