phpseclib gives me a strange erros
Asked Answered
R

3

4

Im trying to use this, but it just gives me this errors and i have no clue how to fix that..

Warning: include_once(Math/BigInteger.php): failed to open stream: No such file or directory in /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php on line 891

Warning: include_once(): Failed opening 'Math/BigInteger.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php on line 891

Warning: include_once(Crypt/Random.php): failed to open stream: No such file or directory in /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php on line 895

Warning: include_once(): Failed opening 'Crypt/Random.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php on line 895

Warning: include_once(Crypt/Hash.php): failed to open stream: No such file or directory in /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php on line 899

Warning: include_once(): Failed opening 'Crypt/Hash.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php on line 899

Warning: include_once(Crypt/Base.php): failed to open stream: No such file or directory in /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php on line 904

Warning: include_once(): Failed opening 'Crypt/Base.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php on line 904

Fatal error: Call to undefined function phpseclib_resolve_include_path() in /home/www/sfs_web/statistics/_public/_functions/Server/Net/SSH2.php on line 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();
Requisition answered 24/9, 2015 at 13:28 Comment(0)
R
10

phpseclib is probably not in your include_path. Quoting phpseclib.sourceforge.net,

<?php
set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');

include('Net/SSH2.php');
?>

You'll need to adjust that as appropriate. If phpseclib is in the vendor/phpseclib directory then do 'vendor/phpseclib' instead, etc.

Rogelioroger answered 24/9, 2015 at 13:58 Comment(0)
D
0

Yep, you need set_include_path. And, in my way I've replace in ssh2.php all include directive

include_once(Math/BigInteger.php)

on

stream_resolve_include_path(Math/*****.php)
Dyeing answered 7/6, 2016 at 9:50 Comment(0)
P
0

For CodeIgniter <=3,

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

Pallaten answered 9/11, 2020 at 2:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.