KNOWNHOST KNOWLEDGE BASE

Hosting Question? Find the Solution - Browse our Guides, Articles, and How-To's

How To Recompile Only a Single Version Of PHP With DirectAdmin’s CustomBuild?

Category: DirectAdmin
Tags: # # #

Let’s say that you have four versions of PHP installed, and you only want to update the default PHP version or php1_release. You know that if you do, recompiling all versions of PHP is going to take a while, so you may be deterred to update because of this. In the following example, we have four versions of PHP and only want to update php1_release from version 7.2 to version 7.3,

php1_release 7.2
php2_release 7.1
php3_release 7.0
php4_release 5.6

You can check the PHP versions and handlers installed using the following command,

grep -P 'php[\d]_' /usr/local/directadmin/custombuild/options.conf
[root@host ~]#   grep -P 'php[\d]_' /usr/local/directadmin/custombuild/options.conf
php1_release=7.2
php1_mode=php-fpm
php2_release=7.1
php2_mode=php-fpm
php3_release=7.0
php3_mode=php-fpm
php4_release=5.6
php4_mode=php-fpm

You can use php_expert to compile only a single version and save yourself some time. Use the below commands like so (provided the PHP version is using PHP-FPM),

cd /usr/local/directadmin/custombuild 
./build set php1_release 7.3 
./build update 
./build php_expert 7.3 php-fpm 
./build rewrite_confs

The system will take some time for the recompilation and viola! The php_expert build option is ideal for busy system administrators eager to save time and provide quicker resolutions for their clients. You can confirm the changes using the same command,

[root@host ~]#   grep -P 'php[\d]_' /usr/local/directadmin/custombuild/options.conf
php1_release=7.3
php1_mode=php-fpm
php2_release=7.1
php2_mode=php-fpm
php3_release=7.0
php3_mode=php-fpm
php4_release=5.6
php4_mode=php-fpm

Conclusion

Now that we’ve gone over how to recompile only a single version of PHP version with DirectAdmin’s CustomBuild. Using this article, you don’t need to recompile all the PHP versions and wasting of your time.

KnownHost offers 365 days a year, 24 hours a day, all 7 days of the week best in class technical support. A dedicated team ready to help you with requests should you need our assistance. You’re not using KnownHost for the best webhosting experience? Well, why not? Check with our Sales team to see what can KnownHost do for you in improving your webhosting experience.