[英]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.