2

In one of my projects am going to connect with alot of servers remotely through SSH using PHP. There are two solutions for it, phpseclib and the ssh2 PECL Extension for PHP which is based on the libssh2 library.

So can anyone please compare both and mention their pros and cons etc?

Samuel Katz
  • 24,066
  • 8
  • 71
  • 57

1 Answers1

8

phpseclib has pretty much zero server requirements. So long as the server supports PHP it'll work. libssh2, in contrast, has to be installed on the server for it to work and a lot of servers don't have it installed. If it is installed you're not going to need to include any additional files (whereas with phpseclib you will have to include them) but that's a big if.

Overall, I think phpseclib's OOP API is far more intuitive and works much more frequently.

Here's a website that critics the two:

http://drupal.org/node/671702

user499524
  • 96
  • 1
  • We used phpseclib because of shared hosting restrictions however now we have dedicated servers switching to libssh2 makes sftp much **much** faster for large numbers of files – Angry Dan Dec 09 '11 at 16:12