DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

Native support of PHP extensions in DirectAdmin

| 21:43:22 17.04.2020

native support of php extensions in directadmin

DirectAdmin can install the following PHP extensions as of August, 2021: 

  • bz2
  • gmp
  • htscanner
  • imagick
  • imap
  • ioncube
  • ldap
  • opcache
  • phalcon
  • readline
  • redis
  • snuffleupagus
  • suhosin
  • xmlrpc
  • zend

The listed extensions can be installed server-wide only, i.e. for all existing users and their domains.

The extensions can not be installed for PHP versions selectively. They will be installed for all PHP versions enabled in options.conf of CustomBuild. And sure some of them will fail to compile for PHP 5.x and some for PHP 7.x.

Enable PHP extensions in DirectAdmin

First change directory to custombuild:

cd /usr/local/directadmin/custombuild

You can run all or any of the following commands depending on what extension you want to enable:

./build set_php bz2 yes
./build set_php gmp yes
./build set_php htscanner yes
./build set_php imagick yes
./build set_php imap yes
./build set_php ioncube yes
./build set_php ldap yes
./build set_php opcache yes
./build set_php phalcon yes
./build set_php readline yes
./build set_php redis yes
./build set_php xmlrpc yes
./build set_php zend yes

Enhanced security for PHP (prior to 7.x):

./build set_php suhosin yes

Enhanced security for PHP (7.x and newer):

./build set_php snuffleupagus yes

You might either install ready security rules for "snuffleupagus" or prepare your own set of rules. This is a subject for a separate article though. And it won't be covered here.

Disable PHP extensions in DirectAdmin:

First change directory to custombuild:

cd /usr/local/directadmin/custombuild

You can run all or any of the following commands depending on what extension you want to disable:

./build set_php bz2 no
./build set_php gmp no
./build set_php htscanner no
./build set_php imagick no
./build set_php imap no
./build set_php ioncube no
./build set_php ldap no
./build set_php opcache no
./build set_php phalcon no
./build set_php readline no
./build set_php redis no
./build set_php snuffleupagus no
./build set_php suhosin no
./build set_php xmlrpc no
./build set_php zend no

Install/update PHP extensions in DirectAdmin:

First change directory to custombuild:

cd /usr/local/directadmin/custombuild

You can run all or any of the following commands depending on what extension you want to install/update:

./build php_bz2
./build php_gmp
./build php_htscanner
./build php_imagick
./build php_imap
./build php_ioncube
./build php_ldap
./build php_opcache
./build php_phalcon
./build php_readline
./build php_redis
./build php_snuffleupagus
./build php_suhosin
./build php_xmlrpc
./build php_zend

Build all PHP extensions set set in the php_extensions.conf

If you want to rebuild or update all enabled PHP extensions in DirectAdmin run the following commands:

cd /usr/local/directadmin/custombuild 
./build update
./build php_extensions

A full list of commands for installing PHP imap extension:

Let's list all commands in one snippet that you will need to run as root to install PHP imap extension on a DirectAdmin server. They will be the following:

cd /usr/local/directadmin/custombuild
./build update
./build set_php imap yes
./build php_imap

If you see the following or a similar error:

Cannot build imap, because you do not have it set in php_extensions.conf file.

You will need to run first:

./build set_php imap yes

Where replace "imap" with a needed extension and try again.

That's it.


p.s. Thanks to Noel  for a feedback.

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition