Answer the question
In order to leave comments, you need to log in
Why are nginx+php-fpm scripts downloaded and not executed?
I put on this link LEMP.
when testing a script, downloading is performed, and not working out.
the config itself:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name 192.168.0.20;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
location ~ /\.ht {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
Do your scripts start with <?
or with <?php
?
Well, look in /var/log/nginx/error.log
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question