Home > Backend Development > PHP Tutorial > Some questions about building a LEMP environment

Some questions about building a LEMP environment

WBOY
Release: 2016-09-23 03:30:11
Original
851 people have browsed it

I set up a LEMP environment under ubuntu 12.04 version. I followed the online tutorial to configure step by step. I found that accessing index.php kept reporting a 404 NOT FOUND error (if the file name is changed back to index.html, it can be accessed normally). How to solve the problem? ?
cgi.fix_pathinfo=0 and listen = /var/run/php5-fpm.sock have been set in the PHP related configuration file
nginx configuration information is as follows:

<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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template