Debian 10 Installing Nginx + PHP + PHP-FPM

Getting ready for running PHP in Debian 10 is just taking few steps. First of all check for updates with…

apt update -y

You may also run upgrade if you wish to upgrade packages…

apt upgrade -y

Now install nginx + php + php-fpm

apt install nginx php-fpm php -y

Edit /etc/nginx/sites-available/default and add index.php to the following line

index index.php index.html index.htm index.nginx-debian.html;

Also uncomment following lines, be careful to not uncomment second fastcgi_pass

  location ~ \.php$ {
                include snippets/fastcgi-php.conf;
        #       # With php-fpm (or other unix sockets):
                fastcgi_pass unix:/run/php/php7.3-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass;

You may restart nginx…

systemctl restart nginx