sudo apt-get install -y php5.6-dev
sudo apt-get install -y php-pear
sudo apt-get install -y pkg-config
sudo pecl channel-update pecl.php.net
sudo pecl install mongodb
sudo apt-get install -y libsslcommon2-dev
# como usuario root
cat > /etc/php/5.6/mods-available/mongodb.ini <<EOM
extension=mongodb.so
EOM
-rw-r--r-- 1 root root 21 Sep 30 00:13 mongodb.ini
ln -s /etc/php/5.6/mods-available/mongodb.ini /etc/php/5.6/cli/conf.d/20-mongodb.ini
ln -s /etc/php/5.6/mods-available/mongodb.ini /etc/php/5.6/apache2/conf.d/20-mongodb.ini
service apache2 restart