duanmei4362 2011-10-30 21:47
浏览 29

phptelnet连接

PHPTelnet always returns

[PHP Telnet] Connect failed: Login failed"

But all logins and passwords absolutely correct. I've checked phgtelnet both on local pc and synology NAS server, with set_time_limit(0), with the same behavior.

Any suggestions?

Nothing special about code, PHPTelnet.php class downloaded from http://www.geckotribe.com/php-telnet/

And calling script:

$telnet = new PHPTelnet();
$telnet->show_connect_error=0;

// if the first argument to Connect is blank,
// PHPTelnet will connect to the local host via 127.0.0.1
$result = $telnet->Connect('172.16.1.1','admin','admin');

switch ($result) {
case 0:
$telnet->DoCommand('uname', $result);
// NOTE: $result may contain newlines
echo $result;
// say Disconnect(0); to break the connection without explicitly logging out
$telnet->Disconnect();
break;
case 1:
echo '[PHP Telnet] Connect failed: Unable to open network connection';
break;
case 2:
echo '[PHP Telnet] Connect failed: Unknown host';
break;
case 3:
echo '[PHP Telnet] Connect failed: Login failed';
break;
case 4:
echo '[PHP Telnet] Connect failed: Your PHP version does not support PHP Telnet';
break;
}
?> 

With enabled ERROR_REPORTING i see the following error:

Notice: fputs() [function.fputs]: send of 5 bytes failed with errno=10053 An established connection was aborted by the software in your host machine
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog