Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP中SSH连接的横幅超时错误_Php_Ssh_Amazon Ec2_Remote Access_Phpseclib - Fatal编程技术网

PHP中SSH连接的横幅超时错误

PHP中SSH连接的横幅超时错误,php,ssh,amazon-ec2,remote-access,phpseclib,Php,Ssh,Amazon Ec2,Remote Access,Phpseclib,我最近下载了phpseclib0.3.1 PHP库,它应该允许我通过SSH连接到EC2实例。然而,我被一条“横幅超时”错误消息困住了。当我打电话时: $ssh = new Net_SSH2('ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com',1234); 第一个参数是公共DNS,第二个参数是与安全组关联的端口(两者正确匹配)。运行此命令时,我会看到以下错误消息: Notice: Cannot connect to ec2-xxx-xxx-xxx-xxx.

我最近下载了phpseclib0.3.1 PHP库,它应该允许我通过SSH连接到EC2实例。然而,我被一条“横幅超时”错误消息困住了。当我打电话时:

$ssh = new Net_SSH2('ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com',1234);
第一个参数是公共DNS,第二个参数是与安全组关联的端口(两者正确匹配)。运行此命令时,我会看到以下错误消息:

Notice: Cannot connect to ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com. Banner timeout in ...\SSH2.php on line 815 注意:无法连接到ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com。第815行…\SSH2.php中的横幅超时 对应于:

    // on windows this returns a "Warning: Invalid CRT parameters detected" error
    // the !count() is done as a workaround for <https://bugs.php.net/42682>
    if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) {


        user_error(rtrim("Cannot connect to $host. Banner timeout"), E_USER_NOTICE);
//在windows上,此操作返回“警告:检测到无效的CRT参数”错误
//这个!count()是作为一种解决方法完成的
如果(!@stream_select($read,$write,$except,$sec,$usec)&&!count($read)){
用户错误(rtrim(“无法连接到$host.Banner超时”),E\u用户通知);
可以从中找到SSH2.php文件。如果我无法解决此问题,在php中有哪些替代方法可以连接到EC2实例


谢谢!

如果在选择流之前删除@,会发生什么?是否开始显示任何错误

具体来说,我想知道您是否会遇到这样的错误:


如果在选择流之前删除@,会发生什么?是否开始显示任何错误

具体来说,我想知道您是否会遇到这样的错误:


该实例可能没有响应ssh请求。您是否确定安全组配置正确,并且是否测试过可以通过常规ssh会话访问该实例?我已经能够通过远程桌面登录到此实例,因此我认为这不是问题所在。通过ssh远程桌面还是仅通过远程桌面?假设您在windows上,您可以启动puTTy并尝试使用SSH吗?或者,启动一个临时实例并发布IP和端口,我可以测试它是否打开。该实例可能没有响应SSH请求。您是否确定您的安全组配置正确,并且已测试您是否可以通过regu访问该实例lar ssh会话?我已经能够通过远程桌面登录到此实例,所以我认为这不是问题。通过ssh或远程桌面进行远程桌面?假设您在windows上,您可以启动puTTy并尝试使用ssh-或者,启动一个临时实例并发布IP和端口,我可以测试它是否打开。