Development #php#programming#ssh 1 min

Binding SSH from PHP

Translation of the original in Catalan. Read it in: CatalàCastellano

I would never have imagined that I would get to do such interesting things and in such a clean way from PHP, but from what I have been able to check it is quite simple. What I needed was to be able to do SCPs from PHP. Well then, there is a PHP module that allows doing not only that but even SSH and authentication both via password and via public-private key. Really useful.

If, like me, you are interested in this idea, the PHP website itself has a manual on how to program with PHP using SSH functions. But if you want to start from the beginning and you also want some very simple examples, a good recommendation is the howto (local) by Kevin van Zonneveld, really simple and useful. I set it up on an Ubuntu Server Dapper 6.06 LTS, I mention it because when he says to install the openssl-dev package, it does not exist in the system I used. You need to install libssl-dev instead and everything will work fine. Also to mention that it has only worked for me with the libssh-0.14 library, newer versions give compilation errors with the PHP SSH2 module.