Installing PHP

Now that we have the web server up and running, we can add the PHP processor that we need to be able to add PHP elements to our page and subsequently create dynamic web content. Nginx uses the PHP FastCGI Process Manager, which is again available from the EPEL repository. We have that set up already from the Nginx install and the earlier install of 389-ds. To install PHP and the PHP-FPM, we can use yum:

# yum install php-fpm

Once installed, we need to edit the FPM so that it uses the correct accounts for Nginx. To do this, we can edit /etc/php-fpm.d/www.conf. We will need to edit the user and group lines from apache to nginx:

user = nginx
group = nginx

We also need to make sure that the Nginx web server knows to forward PHP files ...

Get CentOS System Administration Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.