本文介绍了phpseclib与libssh2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一个项目中,我将使用SSH通过SSH远程连接许多服务器.有两种解决方案, phpseclib ssh2 PECL PHP扩展程序,它基于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?

推荐答案

phpseclib对服务器的要求几乎为零.只要服务器支持PHP,它就可以工作.相比之下,必须在服务器上安装libssh2才能使其正常工作,并且很多服务器都未安装它.如果已安装,则不需要包含任何其他文件(而使用phpseclib则必须包含这些文件),但是如果不这样做的话,那将是一个很大的问题.

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.

总的来说,我认为phpseclib的OOP API更加直观,并且工作频率更高.

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

这篇关于phpseclib与libssh2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-01 19:45