Debian 12 bookworm
Sponsored Link

Nginx : Use PHP Scripts2023/07/04

 
Configure Nginx to use PHP scripts.
[1]
[2] Install PHP-FPM (PHP FastCGI Process Manager).
root@www:~#
apt -y install php-fpm
[3] Configure Apache2.
# 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/php8.2-fpm.sock;
       }

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

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

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