This article describes how to apply our patches for PHP-FPM. First of all, you should download "PHP" archive (Please note that this link will be different for each PHP version). In our case we will use PHP 5.4.45 version:
wget http://nl3.php.net/get/php-5.4.45.tar.gz/from/this/mirror
When download completed, rename, unpack and change its directory:
mv mirror.1 php-5.4.45.tar.gz tar -zxvf php-5.4.45.tar.gz cd php-5.4.45/
Then download the following package which contains all the necessary files to apply patches:
wget http://repo.cloudlinux.com/cloudlinux/sources/da/cl-apache-patches.tar.gz tar -zxvf cl-apache-patches.tar.gz
Before applying CloudLinux patches, please make sure that "liblve-devel" has already been installed into the system:
rpm -qa | grep liblve-devel
liblve-devel-1.3-1.10.el6.cloudlinux.x86_64 If not, please run:
yum install liblve-devel -y
On CloudLinux 7 server - install systemd-devel:
yum install systemd-devel
Apply patch:
patch -p1 < fpm-lve-php5.4.patch
If everything looks fine, please run the following commands to build it (CloudLinux 6):
autoconf ./configure --enable-fpm make
CloudLinux 7 requires systemd support:
autoconf ./configure --enable-fpm --with-fpm-systemd make
When rebuild completed, find a new PHP-FPM binary file:
find . | grep php-fpm
./sapi/fpm/php-fpm To make sure that it contains all our patches run:
strings ./sapi/fpm/php-fpm | egrep "jail|lve"
liblve.so.0 lve_exit init_lve lve_jail_uid destroy_lve lve_enter_flags fpm_lve_enter fpm_lve_leave If everything looks fine, please rename the current PHP-FPM file:
which php-fpm
/usr/local/sbin/php-fpm
mv /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm.old
And copy new one:
cp /root/php-5.4.45/sapi/fpm/php-fpm /usr/local/sbin/
Then you need to restart PHP-FPM service to apply changes and check PHP info page.
It should look as follows:
Comments
0 comments
Please sign in to leave a comment.