问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/4108492/phpseclib-vs-libssh2