run the following command to do so:
#first we update the system
aptitude update
aptitude safe-upgrade
#install necessary packages
aptitude install php5-dev php5-cli php-pear build-essential
#configure openssl
openssl-dev zlib1g-dev
#install libssh2 ext
aptitude install libssh2-1-dev
#install the pecl ext
pecl install -f ssh2
#add the ext to the configuration file
echo ‘extension=ssh2.so’ > /etc/php5/conf.d/ssh2.ini
#restart the apache server
/etc/init.d/apache2 restart
that’s it enjoy