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