CentOS Stream 8
Sponsored Link

Nginx : Use PHP Scripts2021/04/08

 
Configure Nginx to use PHP scripts.
[1]
[2]
After installing PHP, Restart Nginx, it's OK to do it only.
When [Nginx] starts, [php-fpm] also starts for dependency by setting file [/usr/lib/systemd/system/nginx.service.d/php-fpm.conf]. PHP-FPM config file is located at [/etc/nginx/conf.d/php-fpm.conf].
[root@www ~]#
systemctl restart nginx

[root@www ~]#
systemctl status php-fpm

*  php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor pr>
   Active: active (running) since Thu 2021-04-07 19:42:40 JST; 8s ago
 Main PID: 5646 (php-fpm)
   Status: "Ready to handle connections"
    Tasks: 6 (limit: 23673)
   Memory: 10.3M
   CGroup: /system.slice/php-fpm.service
           +-- 5646 php-fpm: master process (/etc/php-fpm.conf)
           +-- 5654 php-fpm: pool www
           +-- 5655 php-fpm: pool www
           +-- 5656 php-fpm: pool www
           +-- 5657 php-fpm: pool www
           +-- 5658 php-fpm: pool www
.....
.....

# create PHPInfo test page

[root@www ~]#
echo '<?php phpinfo(); ?>' > /usr/share/nginx/html/info.php

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