[英]phpseclib 2.0 on CodeIgniter without composer, error about ParagonIE
我正在尝试将phpseclib 2.0与我的应用程序集成以与PHP7.0兼容。 我以前有phpseclib与PHP5一起使用,但是我的PHP7.0机器上的一堆错误提示更新了phpseclib。
我试图不完全使用composer,因为我不想依赖人们安装Composer,所以我在phpseclib的composer.json上运行了本地php composer.phar dump-autoload -o
以生成所需的自动加载。 php并将其上传到我的网络服务器。
这是我的文件设置:
/application
/config
/controllers
/core
/errors
/helpers
/hooks
/language
/logs
/models
/third_party
/phpseclib
<phpseclib2.0 files here>
/vendor
/composer
/autoload_*.php
/ClassLoader.php
autoload.php
在需要SSH2和SFTP的一种模型中,我具有以下内容:
public function __construct() {
require_once(APPPATH . '/third_party/vendor/autoload.php');
$loader = new \Composer\Autoload\ClassLoader();
$loader->addPsr4('phpseclib\\', __DIR__ . '/third_party/phpseclib');
$loader->register();
// Note $ip, $port, $user, $pass called from a config file separately.
$this->ssh_conn = new \phpseclib\Net\SSH2($ip, $port);
$this->sftp_conn = new \phpseclib\Net\SFTP($ip, $port);
$this->ssh_conn->login($user, $pass);
加载页面给我一个错误:
Type: Error
Message: Class 'ParagonIE\ConstantTime\Hex' not found
Filename: /var/www/public_html/application/third_party/phpseclib/Math/BigInteger/Engines/PHP.php
Line Number: 114
回溯:
文件:/var/www/public_html/application/third_party/phpseclib/Math/BigInteger/Engines/Engine.php行:127功能:初始化
文件:/var/www/public_html/application/third_party/phpseclib/Math/BigInteger/Engines/PHP.php行:92功能:__construct
文件:/var/www/public_html/application/third_party/phpseclib/Math/BigInteger.php行:151功能:__construct
文件:/var/www/public_html/application/third_party/phpseclib/Net/SSH2.php行:1670功能:__construct
文件:/var/www/public_html/application/third_party/phpseclib/Net/SSH2.php行:1248功能:key_exchange
文件:/var/www/public_html/application/third_party/phpseclib/Net/SSH2.php行:2126功能:connect
文件:/var/www/public_html/application/third_party/phpseclib/Net/SSH2.php行:2110功能:call_user_func_array
任何帮助表示赞赏。
听起来您正在使用phpseclib的master分支-而不是2.0分支。
最新的2.0版本未使用ParagoneIE \\ ConstantTime \\ Hex。 至少它不是composer.json中的:
https://github.com/phpseclib/phpseclib/blob/2.0.6/composer.json
但是,paragonie / constant_time_encoding位于master分支的composer.json中:
https://github.com/phpseclib/phpseclib/blob/master/composer.json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.