There is simple way on how to quickly install PHP extensions without using custombuild. I used this way many times.
In this case, installation was done on CentOS 7.2 server with Directadmin and PHP version 5.6.23.
1. Navigate to your Directadmin’s custombuild directory. Don’t worry, we won’t use custombuild.
[root@webserver ~]# cd /usr/local/directadmin/custombuild
[root@webserver custombuild]#
2. Search for PHP package and unarchive it.
[root@webserver custombuild]# ls -l | grep php
-rw-r--r-- 1 root root 18428932 Jun 23 18:40 php-5.6.23.tar.gz
[root@webserver custombuild]# tar -xvzf php-5.6.23.tar.gz
3. Go to php directory that was created when you unarchive package.
[root@webserver custombuild]# cd php-5.6.23
[root@webserver php-5.6.23]#
4. Navigate to ext directory where extensions are. Go to directory of extension that you want to install. In this case exif.
[root@webserver php-5.6.23]# cd ext/exif/
[root@webserver exif]#
5. Run phpize. Be sure to run the right one! In my case, phpize path is /usr/local/php56/bin/phpize. I’m using php version 5.6 on CentOS server. Change this accordingly to your installation.
[root@webserver exif]# /usr/local/php56/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
6. Run configure. Again, be sure to include right php-config file!
[root@webserver exif]# ./configure --with-php-config=/usr/local/php56/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
...
7. Then run make. You should see part that says “Libraries have been installed in” and “Build complete”.
[root@webserver exif]# make
...
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/directadmin/custombuild/php-5.6.23/ext/exif/modules
Build complete.
...
8. Install extension by run make install. You’ll also see in which directory extension was installed.
[root@webserver exif]# make install
Installing shared extensions: /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/
[root@webserver exif]# cd /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/
[root@webserver no-debug-non-zts-20131226]# ls
exif.so opcache.a opcache.so
9. Open your php.ini file and find part where it says extension_dir. Add this line below commented “; extension_dir = ext” part. In my case is exif extension. Change this according to your install.
...
; extension_dir = "ext"
extension=exif.so
...
10. Restart apache and check if extension is installed. In my case, there is.
[root@webserver exif]# php -m | grep exif
exif