Nginx : PHP + PHP-FPM2019/08/07 |
Install PHP-FPM ( PHP FastCGI Process Manager ) to use PHP scripts on Nginx.
|
|
[1] | Install PHP and PHP-FPM. |
root@www:~# apt -y install php php-fpm php-common php-pear php-mbstring
|
[2] | Configure Nginx for PHP-FPM. |
root@www:~#
vi /etc/nginx/sites-available/default # add into [server] section location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.3-fpm.sock; } systemctl restart php7.3-fpm nginx |
[3] | Create [PHPInfo] in Virtualhost's web-root you set PHP-FPM and access to it, then it's OK if [FPM/FastCGI] is displayed. |
root@www:~# echo "<?php phpinfo() ?>" > /var/www/html/info.php |
Sponsored Link |
|