PHP-FPM widely known as the FastCGI process Manager, it is an improvement in PHP FastCGI implementation with more useful features for handling high-load servers and Web sites. Some of these features are listed below:
• Advanced process management capabilities with elegant (graceful) Start/stop options.
• Different user identities/groups can be used to listen to multiple ports and use multiple PHP configurations.
• Error logging.
• Support for upload acceleration.
• Especially for the ability to end requests and erase all data when dealing with some time-consuming tasks.
• Supports both dynamic and static child process rebirth.
• IP address restrictions are supported.
Next, we'll talk about installing PHP-FPM on Nginx and Apache on the CentOS 7 server running CPanel 11.52 and EA3, and how to manage these installed multiple PHP-FPM instances through CPanel.
Before we start the installation, let's look at the prerequisites for installation.
Enable the modproxyfcgi module
Enable Mpm_event
Since we are installing PHP-FPM to a EA3 server, we need to run Easyapache to compile Apache to enable these modules.
Here, brother even PHP training will outline the following installation steps for you.
Step 1: Install the Epel warehouse
Step 2: Install the Ndeploy RPM Warehouse, which is the most important step in this installation.
Step 3: Install the Ndeploy and Nginx plugins from the Ndeploy warehouse using Yum.
Step 4: Enable/configure Nginx as the reverse proxy.
After you complete these steps, install the PHP-FPM package for all available PHP versions of the server, and EA3 use the Remi Warehouse to install the packages. You can run this Ndeploy script to download all the packages.
[Email protected] [~]#/opt/ndeploy/scripts/easy_php_setup.sh
Loaded Plugins:fastestmirror, Tsflags, Universal-hooks
EA4 | 2.9 KB 00:00:00
Base | 3.6 KB 00:00:00
Epel/x86_64/metalink | 9.7 KB 00:00:00
Epel | 4.3 KB 00:00:00
Extras | 3.4 KB 00:00:00
Updates | 3.4 KB 00:00:00
(a): Epel/x86_64/updateinfo | 460 KB 00:00:00
(2/2): epel/x86_64/primary_db
Running this script will install all these FPM packages for PHP 54,php 55,php 56 and PHP 70.
Installed Packages
php54-php-fpm.x86_64 5.4.45-3.el7.remi @remi
php55-php-fpm.x86_64 5.5.31-1.el7.remi @remi
php56-php-fpm.x86_64 5.6.17-1.el7.remi @remi
php70-php-fpm.x86_64 7.0.2-1.el7.remi @remi
After the installation is complete, you need to enable PHP-FPM SAPI for Apache. You can run the following script to enable the PHP-FPM instance.
[Email protected] [~]#/opt/ndeploy/scripts/apache_php-fpm_setup.sh Enable
Mod_proxy_fcgi.c
Choose one default PHP version from the list below
PHP70
PHP56
PHP54
PHP55
Provide the exact desired version string here and press ENTER:PHP54
Confgen:: Lxblogger
Confgen:: Blogr
Confgen:: Saheetha
Confgen:: SATest
Which:no Cagefsctl in (/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/ X11r6/bin:/root/bin)
info [rebuildhttpdconf] Missing owner for Domain server1.centos7-test.com, force lookup to root
Built/usr/local/apache/conf/httpd.conf OK
Waiting for "httpd" to restart gracefully ... waiting for "httpd" to initialize ...
... finished.
It will ask you which PHP version you need to run as the default version of the server, you can enter those details, and then continue to configure and generate the virtual host file for the existing domain name.
The default php-fpm on my server is PHP 54, and I'm just about to change the PHP-FPM instance of my domain name to PHP 55 alone. After you modify the PHP-FPM for your domain, you can confirm it by visiting the Phpinfo page.
Apache's php-fpm-Enable instance