Ubuntu 20.04
Sponsored Link

Nginx : Use PHP Scripts2020/08/28

 
Configure Nginx to use PHP scripts.
[1]
[2] Additionally, Install PHP-FPM (PHP FastCGI Process Manager).
root@www:~#
apt -y install php7.4-fpm
# add settings into [server] section of a site definition

root@www:~#
vi /etc/nginx/sites-available/default
        location ~ \.php$ {
               include snippets/fastcgi-php.conf;
               fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        }

root@www:~#
systemctl restart php7.4-fpm nginx
# create PHPInfo test page

root@www:~#
echo '<?php phpinfo(); ?>' > /var/www/html/info.php

[3] Verify to access to PHPInfo test page from any client computer.
Matched Content