【发布时间】:2013-12-11 04:18:45
【问题描述】:
我在我的 wordpress 网站中安装了 phpseclib。每次我运行这个脚本时,它都会显示空白页,甚至隐藏 wordpress 管理栏。
include('Net/SSH2.php');
$ssh = new Net_SSH2('www.domain.tld');
if (!$ssh->login('username', 'password'))
{
exit('Login Failed');
}
echo $ssh->exec('pwd');
echo $ssh->exec('ls -la');`
但后来我把库放在了 wordpress 之外,它工作得很好。可能是什么问题呢?我真的需要在 wordpress 中运行的代码。提前致谢!
【问题讨论】:
-
这就是我包含库的方式: set_include_path(get_include_path() . get_include_path().'/phpseclib');包括('Net/SSH2.php');
-
你不需要做两次 get_include_path() ;)
-
对不起。那是一个错字。我只包括了一次。
标签: php wordpress ssh phpseclib