Enabling/Disabling PHP extensions in DirectAdmin CustomBuild.
By Bijin R Bhadran on April 27th, 2021
DirectAdmin can install the following PHP extensions server-wide:
“gmp, ioncube, imagick, imap, opcache, phalcon, suhosin, xmlrpc, zend”
In this tutorial, we are going to enable and disable above PHP extensions in Directadmin CustomBuild.
Enable PHP extensions
1) Log in to your server via SSH.
2) Change directory to custombuild and run an update.
3) You can run all or any of the following commands depending on what extension you want to enable:
./build set_php gmp yes
./build set_php ioncube yes
./build set_php imagick yes
./build set_php imap yes
./build set_php opcache yes
./build set_php phalcon yes
./build set_php suhosin yes
./build set_php xmlrpc yes
./build set_php zend yes
4) You can run all or any of the following commands depending on what extension you want to install/update:
Disable PHP extensions
You can disable all or any of the PHP extensions by running all or any of following commands depending on what extensions you want to disable in step 3.
./build set_php gmp no
./build set_php ioncube no
./build set_php imagick no
./build set_php imap no
./build set_php opcache no
./build set_php phalcon no
./build set_php suhosin no
./build set_php xmlrpc no
./build set_php zend no
Verification of Enabled Extension.
You can verify the extensions eithe by using command “php -m” from command line or by using php.info page.
Steps to create php.info file is mentioned below
Go to the document root of the website. Then create a file using the following command
Add this line to this file
<? phpinfo(); ?>
Press esc key on the keyboard and type the following command then enter so that the file will be saved:
Change the ownership of info.php to the corresponding username of the cPanel account
chown (username):(username) info.php
Now check the php version of your website by calling the domain along with info.php