1

I tried everything and searched everywhere.

I'm following this guide: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-20-04

My config file:

server {
listen 80;
server_name your_domain www.your_domain;
root /var/www/your_domain;

index index.html index.htm index.php;

location / {
    try_files $uri $uri/ =404;
}

location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
 }

location ~ /\.ht {
    deny all;
}

}

I created a info.php file. When I visit mydomain.com/info.php it download the file instead of executing it. Already cleared browser cache, also in NGINX.

5
  • 1
    I just saw that in the configuration file the character "~" is missing for the 2 "location" config. Could it be the error?
    – Giovanni
    Apr 29, 2021 at 19:37
  • 1
    It may, but it also means you did not copy and paste the contents of your config file into the question, which will make it exceptionally difficult to successfully answer your question.
    – Paul
    Apr 29, 2021 at 20:54
  • Check if php-fpm is actually started: systemctl status php7.4-fpm.service then have a look at the log files.
    – digijay
    Apr 29, 2021 at 21:27
  • @digijay yes, I already checked also the path
    – Giovanni
    Apr 29, 2021 at 22:08
  • @Paul I'm searching a solution to paste the tilde
    – Giovanni
    Apr 29, 2021 at 22:08

1 Answer 1

0

Solved by myself. Here is the solution:

I double checked the configuration file uploaded to my server and I found that 2 tilde were missing after the "location" config. I just added them and everything is working

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .