Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to be able to run PHP functions like ssh2_connect. But, those functions are not available on my machine. What do I need to do to install them?

I am using Ubuntu 8.04 Hardy Heron.

share|improve this question
up vote 2 down vote accepted

The Ubuntu package index lists libssh2-php packages for several tastes (lucid to oneiric). You can look if your system has all the required software, download the libssh2-php.deb from Lucid and install it

sudo dpkg -i libssh2-php*.deb

or use gdebi.

If this don't work you can download the source code from and compile it for yourself.

share|improve this answer
This probably won't work because of the version differences. – Marco Ceppi Sep 6 '11 at 20:59
ACK, thatswhy I recommended to look if Adam has all the necessary software installed. – qbi Sep 6 '11 at 21:11
You can try to grab it with php-pear :) – Marco Ceppi Sep 6 '11 at 21:34

you can use below command for install ssh2

sudo pecl channel-update
sudo apt-get install libssh2-1-dev
sudo pecl install -a ssh2-0.12
echo '' | sudo tee /etc/php5/mods-available/ssh2.ini > /dev/null
sudo php5enmod ssh2
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.