【问题标题】:Not able to launch putty with telnet session using php无法使用 php 通过 telnet 会话启动 putty
【发布时间】:2012-07-06 02:44:41
【问题描述】:

我的桌面上有 putty.exe,所以如果我转到命令提示符,然后转到 C:\Documents and Settings\user\Desktop 位置并执行以下命令,它将启动 telnet 连接到指定服务器的 Putty 窗口:

putty.exe telnet://a.b.c.d/

我正在尝试使用以下命令将 putty 启动到 telnet 到特定服务器,但它对我不起作用:

<?php
$securecrt = "C:\\Documents and Settings\\user\\Desktop\\putty.exe telnet://a.b.c.d/ ";


exec($securecrt);
?>

If I try following then it launches the putty application but will have to provide the host name or IP to login:

<?php
$securecrt = "C:\\Documents and Settings\\user\\Desktop\\putty.exe ";


exec($securecrt);
?>

不确定我是否遗漏了一些非常基本的东西,如果有人可以帮助解决这个问题,那就太好了。

【问题讨论】:

  • 这个问题似乎错过了您的尝试方式。但是一个疯狂的猜测:您在 Web 服务器中运行 PHP 作为服务。那时就没有桌面了。
  • 这个问题与编程无关。
  • 我在我的 xp 桌面上使用 wampserver。我正在尝试使用 PHP 程序触发某些东西或启动某些东西,但它不起作用。
  • 一定要用putty吗? stackoverflow.com/q/905348/664479有解决办法...
  • 使用 putty 我将能够让用户选择交互并在需要时执行其他命令,而 fsock 不确定我是否能够。

标签: php


【解决方案1】:

您可以尝试将 PHP 与 fsock 一起使用,或者使用 http://www.geckotribe.com/php-telnet/ 之类的类,而不是使用 Putty。

但是,您可以使用当前设置尝试以下操作:

$securecrt = '"C:\Documents and Settings\user\Desktop\putty.exe" telnet://a.b.c.d/';

【讨论】:

  • 不,它没有帮助!它甚至不启动 putty.exe 应用程序。
猜你喜欢
  • 2014-03-16
  • 2014-03-23
  • 2016-03-09
  • 2017-07-26
  • 2015-01-02
  • 2014-08-14
  • 2013-06-13
  • 2014-12-10
  • 2012-08-03
相关资源
最近更新 更多