Apache PHP-FPM-enabled instance

巴扎黑
Release: 2016-11-08 10:35:52
Original
906 people have browsed it

PHP-FPM-enabled instance for Apache

PHP-FPM is widely known as the FastCGI process manager, it is an improvement of the PHP FastCGI implementation with more useful features for handling high-load servers and websites www .lampbrother.net. Some of these features are listed below:
·Advanced process management capabilities with graceful start/stop options.
·You can listen to multiple ports and use multiple PHP configurations through different user identities/group identities.
·Error logging.
·Support upload acceleration.
·Especially used to end requests and clear all data when processing some time-consuming tasks.
·Supports both dynamic and static child process rebirth.
·Support IP address restriction.
What we are going to discuss next is installing PHP-FPM on Nginx and Apache on a 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 take a look at the prerequisites for installation.
Enable Modproxyfcgi module
Enable MPM_Event
Since we are going to install PHP-FPM to an EA3 server, we need to run EasyApache to compile Apache to enable these modules.
Here, Band of Brothers PHP training will briefly outline the following installation steps for you.
Step 1: Install the Epel repository
Step 2: Install the nDeploy RPM repository. This is the most important step in this installation.
Step 3: Use yum to install nDeploy and Nginx plugins from the nDeploy repository.
Step 4: Enable/configure Nginx as a reverse proxy.
After completing these steps, install the PHP-FPM package for all PHP versions available in the server. EA3 uses the remi repository to install these packages. You can run this nDeploy script to download all packages.

root@server1 [~]# /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
(1/2) : 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 above installation is completed, you need to enable PHP-FPM SAPI for Apache. You can run the following script to enable the PHP-FPM instance.
root@server1 [~]# /opt/nDeploy/scripts/apache_php-fpm_setup.sh enable
mod_proxy_fcgi.c
Please 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:: blogger
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 You can enter those details about which PHP version you want to run as the server's default version, then proceed with configuration and generate virtual host files for existing domain names.

The default PHP-FPM on my server is PHP 54, and I am about to individually modify the PHP-FPM instance of my domain name to PHP 55. After you have modified PHP-FPM for your domain, you can confirm this by visiting the phpinfo page.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!