One of the most annoying PHP extensions to install has to be SSH2, not only does it have a few errors when you try to compile it, all these tutorials on the web teach you a really hard way.
This is by far the easiest way to install it, and doesn’t require any editing!
Step 1. Install some requirements (oh and make sure php is installed first)
yum install php-devel php-pear gcc make openssl openssl-devel
Step 2. Download libssh2, compile and install it
mkdir libssh2 cd libssh2 wget http://www.libssh2.org/download/libssh2-1.2.8.tar.gz tar xvzf lib* cd lib* ./configure make make install
Step 3. Install the SSH2 module
pecl install ssh2-beta
It will ask for libssh etc locations but just press enter for default, it will try to put the extension in your php.ini automatically but usually fails. So just find your php.ini (usually /etc/php.ini) and place extension=ssh2.so in there
And restart apache, php-cgi, nginx whatever you have running and there you go. php-ssh2 installed. That wasn’t hard, was it?
Ill have a Debian version soon, Debian calls everything wacky names in the repo, so these steps won’t work.