Phpseclib gives me weird erros

I am trying to use this, but it just gives me these errors and I donโ€™t know how to fix it.

Warning: include_once (Math / BigInteger.php): could not open the stream: There is no such file or directory in / home / www / sfs _web / statistics / _public / _functions / Server / Net / SSH2.php on line 891

Warning: include_once (): Failed to open 'Math / BigInteger.php' to include (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): could not open the stream: There is no such file or directory in / home / www / sfs _web / statistics / _public / _functions / Server / Net / SSH2.php on line 895

Warning: include_once (): Failed to open 'Crypt / Random.php' to enable (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): stream could not be opened: no such file or directory in / home / www / sfs _web / statistics / _public / _functions / Server / Net / SSH2.php on line 899

Warning: include_once (): Failed to open 'Crypt / Hash.php' to include (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): stream could not be opened: no such file or directory in / home / www / sfs _web / statistics / _public / _functions / Server / Net / SSH2.php on line 904

Warning: include_once (): Failed to open 'Crypt / Base.php' to enable (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: function call undefinedphpseclib_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(); 
+3
php phpseclib
source share
2 answers

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

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

You will need to adjust this accordingly. If phpseclib is in the vendor / phpseclib directory, then instead of 'vendor/phpseclib' , etc.

+5
source share

Yes you need set_include_path. And, in my opinion, I replaced all include directive in ssh2.php

 include_once(Math/BigInteger.php) 

on

 stream_resolve_include_path(Math/*****.php) 
0
source share

All Articles