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