【问题标题】:phpseclib gives me a strange errosphpseclib 给了我一个奇怪的错误
【发布时间】:2015-12-22 03:12:28
【问题描述】:

我正在尝试使用它,但它只是给了我这个错误,我不知道如何解决这个问题..

警告:include_once(Math/BigInteger.php):无法打开流:否 这样的文件或目录在 /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php 第 891 行

警告:include_once():无法打开“Math/BigInteger.php” 包含 (include_path='.:/usr/share/php:/usr/share/pear') 在 /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php 第 891 行

警告:include_once(Crypt/Random.php):打开流失败:否 这样的文件或目录在 /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php 第 895 行

警告:include_once():无法打开“Crypt/Random.php” 包含 (include_path='.:/usr/share/php:/usr/share/pear') 在 /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php 第 895 行

警告:include_once(Crypt/Hash.php):打开流失败:没有这样的 文件或目录在 /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php 第 899 行

警告:include_once():未能打开“Crypt/Hash.php”以进行包含 (include_path='.:/usr/share/php:/usr/share/pear') 在 /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php 第 899 行

警告:include_once(Crypt/Base.php):无法打开流:没有这样的 文件或目录在 /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php 第 904 行

警告:include_once():未能打开“Crypt/Base.php”以包含在内 (include_path='.:/usr/share/php:/usr/share/pear') 在 /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php 第 904 行

致命错误:调用未定义的函数 phpseclib_resolve_include_path() 在 /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php 第 1226 行

include('Net/SSH2.php');
$ssh = new Net_SSH2('host');
if (!$ssh->login('user', 'pass')) {
  echo('Login Failed');
}

$ssh->exec('the cmd line...");
$ssh->disconnect();

【问题讨论】:

    标签: php phpseclib


    【解决方案1】:

    phpseclib 可能不在您的 include_path 中。引用phpseclib.sourceforge.net

    <?php
    set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');
    
    include('Net/SSH2.php');
    ?>
    

    您需要根据需要进行调整。如果 phpseclib 在 vendor/phpseclib 目录中,则改为使用 'vendor/phpseclib',等等。

    【讨论】:

      【解决方案2】:

      是的,你需要 set_include_path。 而且,以我的方式,我已经在 ssh2.php 中替换了所有包含指令

      include_once(Math/BigInteger.php)
      

      stream_resolve_include_path(Math/*****.php)
      

      【讨论】:

        【解决方案3】:

        对于 CodeIgniter

        set_include_path(get_include_path() . PATH_SEPARATOR . APPPATH.'libraries/phpseclib');

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2021-09-20
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多