Try this:
-
Edit
/etc/nginx/sites-available/default -
Uncomment both listen lines to make Nginx listen on port 80 IPv4 and IPv6.
listen 80; ## listen for ipv4; this line is default and implied listen [::]:80 default_server ipv6only=on; ## listen for ipv6 -
Leave
server_namealone# Make site accessible (...) server_name localhost; -
Add
index.phpto theindexlineroot /usr/share/nginx/www; index index.php index.html index.htm; -
Uncomment
location ~ \.php$ {}# pass the PHP scripts to FastCGI server listening on (...) # location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+?\.php)(/.+)?$; # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini # With php5-cgi alone: #fastcgi_pass 127.0.0.1:9000; # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } -
Edit
/etc/php5/fpm/php.iniand make surecgi.fix_pathinfois set to0 -
Restart Nginx and php5-fpm
sudo service nginx restart && sudo service php5-fpm restart
I just started using Linux a week ago, so I really hope to help you with this. I am using a nano text editor to edit the files. run apt-get install nano if you don’t have it. Google it to know more.