1
如何解決長期的環境變量未設置:在PHP中使用這個腳本時SSH
echo "<br>";
echo "<pre>";
echo $ssh->exec('top');
echo "</pre>";
我得到這個錯誤:未設置
TERM Enivronment變量。
如何解決長期的環境變量未設置:在PHP中使用這個腳本時SSH
echo "<br>";
echo "<pre>";
echo $ssh->exec('top');
echo "</pre>";
我得到這個錯誤:未設置
TERM Enivronment變量。
做$ssh->enablePTY()
。看到這一點:
http://phpseclib.sourceforge.net/ssh/pty.html#top
請注意,您必須使用File_ANSI(),以免輸出不會讓有很大的意義。例如。
$ssh->enablePTY();
$ssh->exec('top');
$ssh->setTimeout(5);
$ansi->appendString($ssh->read());
echo $ansi->getScreen();