我试图使用这个,但它只是给我这个错误,我不知道如何解决这个问题..
警告:include_once(Math/BigInteger.php):无法打开流:891行/home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php中没有此类文件或目录
警告:include_once():在/ home/www/sfs_web/statistics/_public /中打开'Math/BigInteger.php'以包含(include_path ='.:/ usr/share/php:/ usr/share/pear')失败第891行的_functions/Server/Net/SSH2.php
警告:include_once(Crypt/Random.php):无法打开流:第895行/home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php中没有此类文件或目录
警告:include_once():在/ home/www/sfs_web/statistics/_public /中打开'Crypt/Random.php'以包含(include_path ='.:/ usr/share/php:/ usr/share/pear')失败第895行的_functions/Server/Net/SSH2.php
警告:include_once(Crypt/Hash.php):无法打开流:899行/home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php中没有此类文件或目录
警告:include_once():在/ home/www/sfs_web/statistics/_public /中打开'Crypt/Hash.php'以包含(include_path ='.:/ usr/share/php:/ usr/share/pear')失败第899行的_functions/Server/Net/SSH2.php
警告:include_once(Crypt/Base.php):无法打开流:第904行/home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php中没有此类文件或目录
警告:include_once():在/ home/www/sfs_web/statistics/_public /中打开'Crypt/Base.php'以包含(include_path ='.:/ usr/share/php:/ usr/share/pear')失败第904行的_functions/Server/Net/SSH2.php
致命错误:在第1226行的/home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php中调用未定义的函数phpseclib_resolve_include_path()
include('Net/SSH2.php');
$ssh = new Net_SSH2('host');
if (!$ssh->login('user', 'pass')) {
echo('Login Failed');
}
$ssh->exec('the cmd line...");
$ssh->disconnect();
Run Code Online (Sandbox Code Playgroud)
phpseclib可能不在你的include_path中.引用phpseclib.sourceforge.net,
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');
include('Net/SSH2.php');
?>
Run Code Online (Sandbox Code Playgroud)
您需要根据需要进行调整.如果phpseclib在vendor/phpseclib目录中,那么请'vendor/phpseclib'改为等.