[英]phpseclib SSH2 hangs at Math_BigInteger::modPow()
我已經嘗試了SSH2的基本示例,但是它掛了。
<?php
ini_set('display_errors', 1);
include('Net/SSH2.php');
$host = '192.168.100.101';
$ssh = new Net_SSH2($host);
如果我設置時間限制,例如1000秒:
<?php
ini_set('display_errors', 1);
set_time_limit(1000);
include('Net/SSH2.php');
$host = '192.168.100.101';
$ssh = new Net_SSH2($host);
我會得到:
Fatal error: Maximum execution time of 1000 seconds exceeded in /path/to/Math/BigInteger.php on line 1060
Stack trace:
# Time Memory Function Location
1 0.0014 647704 {main}( ) ../index.php:0
2 0.0219 2203280 Net_SSH2->Net_SSH2( ) ../index.php:14
3 0.1114 4439056 Net_SSH2->_key_exchange( ) ../SSH2.php:952
4 0.1837 4520224 Math_BigInteger->modPow( ) ../SSH2.php:1309
5 0.1840 4521888 Math_BigInteger->_slidingWindow( ) ../BigInteger.php:1723
6 0.1842 4523144 Math_BigInteger->_prepareReduce( ) ../BigInteger.php:1817
7 0.1842 4523144 Math_BigInteger->_reduce( ) ../BigInteger.php:1912
8 0.1842 4523144 Math_BigInteger->_barrett( ) ../BigInteger.php:1876
9 0.1844 4536024 Math_BigInteger->divide( ) ../BigInteger.php:2032
10 1001.4549 4577384 Math_BigInteger->subtract( ) ../BigInteger.php:1497
11 1001.4549 4586584 Math_BigInteger->_subtract( ) ../BigInteger.php:991
有誰知道是什么原因造成的?
提前致謝。
更多信息:我使用PHP 5.3.28作為Linux x86_64上Apache 2.2.10的模塊。
您正在使用phpseclib的最慢的模式,所以這無濟於事。 但是,那...
嘗試最新的git版本。 特別是,此提交將導致輕微加速:
https://github.com/phpseclib/phpseclib/commit/e4ff01f05475e81a56681ebfdb5473a07099e5ea
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.