I am getting the same error when trying to load the info.php file and have been trying to solve it for hours but can’t seem to find a solution.
I installed LEMP with 16.04 but it seems hard to find why my php is not working.
My nginx sites-available file looks like this:
server { listen 80; listen [::]:80;
server_name website.com www.website.com;
location / {
root /var/www/website.com/html;
index index.html index.htm index.php index.nginx-debian.html;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
server { listen 443; ssl on; # ssl_certificate ssl_certificate /etc/nginx/cert_chain.crt; # ssl_certificate_key ssl_certificate_key /root/website.com.key;
server_name website.com website.com;
access_log /var/log/nginx/nginx.vhost.access.log;
error_log /var/log/nginx/nginx.vhost.error.log;
location / {
root /var/www/website.com/html;
index index.php index.html index.htm index.nginx-debian.html;
}
location ~ .php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; }
location ~ /\.ht {
deny all;
}
}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
I found and resolved the issue, I moved ``` root /var/www/website.com/html; index index.html index.htm index.php index.nginx-debian.html;
server { listen 80; listen [::]:80;
This comment has been deleted
@demoskp
You need first to enable this site by creating a symbolic link for this site in
sites-enabled
directoryuse this command to achieve this:
sudo ln -s /etc/nginx/sites-available/<sitename> /etc/nginx/sites-enabled/<sitename>
then restart nginx:
sudo service nginx restart
Hope this helps