How to patch php-fpm binary file

This article describes how to apply our patches for PHP-FPM.

First of all you should donwload “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:

When download process completed, rename, unpack and change its directory:

Then download the following package which contains all the necessary files to apply patches:

Before applying CloudLinux patches, please make sure that “liblve-devel” has already been installed into the system:

liblve-devel-1.3-1.10.el6.cloudlinux.x86_64

If not, please run:

 

On CloudLinux 7 server – install systemd-devel:

 

Apply patch:

If everything looks fine, please run the following commands to build it (CloudLinux 6 and CloudLinux 5):

CloudLinux 7 requires systemd support:

 

When rebuild process completed, find a new php-fpm binary file:

./sapi/fpm/php-fpm

To make sure that it contains all our patches run:

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 current php-fpm file:

/usr/local/sbin/php-fpm

And copy new one:

Then you need to restart PHP-FPM service to apply changes and check php info page.

It should looks like this:

PHP-FPM

 

 

 

 

 

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *