apt-get install php5-dev php5-cli php-pear pecl install mongo
Open your php.ini file and add to it:
It is recommended to add this to the section with the other “extensions”, but it will work from anywhere within the php.ini file.
Restart your web server (Apache, nginx, etc.) for the change to take effect.