phpseclib 与 libssh2
在我的一个项目中,我将使用 PHP 通过 SSH 远程连接许多服务器。 有两种解决方案, phpseclib 和 ssh2 PHP 的 PECL 扩展,基于 libssh2 库。
那么有人可以比较一下两者并提及它们的优缺点等吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
phpseclib 对服务器的要求几乎为零。只要服务器支持 PHP 就可以工作。相比之下,libssh2 必须安装在服务器上才能工作,而许多服务器没有安装它。如果安装了它,您将不需要包含任何其他文件(而使用 phpseclib 则必须包含它们),但这是一个很大的假设。
总的来说,我认为 phpseclib 的 OOP API 更加直观并且工作更加频繁。
这是批评两者的网站:
http://drupal.org/node/671702
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