Asked  1 Year ago    Answers:  5   Viewed   8 times

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();

 Answers

2

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.

Saturday, May 29, 2021
 
HamidR
 
4

One thing I dont understand is why on http://phpseclib.sourceforge.net/sftp/examples.html#stat it states that the classname is NET_SFTP when in the source its clearly called SFTP.

The website is documenting the 1.0 branch. The 2.0 branch has a similar API but it is not identical. In particular, it is namespaced whereas the 1.0 branch isn't.

To modify your first example...

<?php
include '/vendor/autoload.php';

$sftp = new phpseclibNetSFTP('domain');
if (!$sftp->login('user', 'pass')) {
    exit('Login Failed');
}

The master branch's API is subject to change. Only 1.0 and 2.0 have fixed API's. As such I think an update to your composer.json would also be appropriate. ie. do "phpseclib/phpseclib": "~2.0" instead of *.

Saturday, May 29, 2021
 
1

You're using the slowest possible mode of phpseclib, so that's not going to help. But, that said...

Try the latest git version. In particular, this commit should result in a slight speedup:

https://github.com/phpseclib/phpseclib/commit/e4ff01f05475e81a56681ebfdb5473a07099e5ea

Saturday, May 29, 2021
 
HamidR
 
4

This happens when the system's user doesn't have iCloud Keychain enabled. As will often be the case on the Simulator :)

I ran into this on the simulator and came here. Tried it on my phone (where iCloud Keychain is enabled), and got this instead:

[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: your.bundle.id due to error: Cannot save passwords for this app. Make sure you have set up Associated Domains for your app and AutoFill Passwords is enabled in Settings

So this is Apple's cool AutoFill feature. There are some steps described here that should enable that.

Thursday, July 29, 2021
 
jab
 
jab
5

You seem to be trying to read a file carrying a so called BOM (Byte Ordering Mark).

Test for such prefixes and if they are around used the potenial info draw from it, then go on and read the file, interpreting it as the BOMs indicates.

The sequence 357 273 277 indicates UTF-8 is following. Which does not need to take byte-ordering into account, as the byte is the unit for such files.

More on the various existing BOMs here: http://en.wikipedia.org/wiki/Byte_order_mark#Representations_of_byte_order_marks_by_encoding

Thursday, January 6, 2022
 
Matt
 
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :