If you have already compiled and installed PHP and need to install more extension, I will show you a quick-n-dirty way of installing and compiling your desired extension without re-compiling everything
cd /tmp
wget -O php-5.6.22.tar.gz http://pl1.php.net/get/php-5.6.22.tar.gz/from/this/mirror
tar -zxvf php-5.6.22.tar.gz
cd php-5.6.22
I will install Imap extension in this example :
cd /tmp/php-5.6.22/ext/imap/
phpize
### if you get autoconf error :
yum install autoconf
./configure --with-libdir=lib64 --with-kerberos --with-imap-ssl
make
$ php -i | grep extension_dir
- extension_dir => /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226 => /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226
Copy the extension to that directory.
cp /tmp/php-5.6.22/ext/imap/modules/imap.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
# find your .ini file
$ php --ini
# Add to file
extension=imap.so
# In case of Apache
$ /etc/init.d/httpd restart
$ /etc/init.d/apache2 restart
# php-fpm:
$ /etc/init.d/php-fpm restart
Like (y)