Home >Backend Development >PHP Tutorial >Some questions about building a LEMP environment
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>