Installing ssh2 module in php – make: *** [ssh2.lo] Error 1

Some will try to use a webserver/php to open ssh connections to the servers without using a ssh client.

At this point you need Openssl, libssh2 installed on the server and of course ssh2 php module.

The only issue is that the latest ssh2 module is in Beta only and most of the time it will be impossible to install it using PECL or PEAR so the only way to do it will be using the tarball.

The latest tarball has also an issue as it may not compile correctly ending in a make: *** [ssh2.lo] Error 1 error . This is because of the tarball actually and there is a patch for it but the easiest way to get over this will be the next fix:

1. Extract the files from the tarball
2. Edit ssh2.c and look for :
#if LIBSSH2_APINO < 200412301450
3. Change the line to look like:
#if LIBSSH2_VERSION_NUM < 0x001000
4. Save and run phpize && ./configure --with-ssh2 && make from within the directory .

I will try to post a full how-to on the full installation this days.

Share/Bookmark