【发布时间】:2014-05-12 10:41:09
【问题描述】:
我已经尝试了 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
有人知道是什么原因造成的吗?
提前致谢。
更多信息: 我在 Linux x86_64 上使用 PHP 5.3.28 作为 Apache 2.2.10 的一个模块。
【问题讨论】:
-
看起来像一个无限循环,也许你的密钥中的数字比 phpseclib 预期的要大。如果你用
--with-openssl编译PHP,你应该使用那些函数。