Install PHP

Again, yum is used to install binaries.

#yum install php php-mysql php-fpm

php-fpm is required for nginx

To enhance the functionality of PHP, we can optionally install some additional modules.

To see the available options for PHP modules and libraries,  type this into your system:

#yum search php-

No additional modules were installed, other than mysql and fpm.

In order for it all to work with nginx, there are some config changes to make (see the LEMP section in the biblio for details):

#vi /etc/php.ini


; cgi.fix_pathinfo=1



Save and close the file.

#vi /etc/php-fpm.d/www.conf

Look for the following config directives and change to match what's here:

listen = /var/run/php-fpm/php-fpm.sock

listen.owner = nobody = nobody

user = nginx
group = nginx

Save and close the file.

Start the PHP processor and enable startup at boot:

#systemctl start php-fpm
#systemctl enable php-fpm