php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75523 stream_set_timeout(): No support for ssh2 stream timeout
Submitted: 2017-11-14 11:41 UTC Modified: 2021-02-10 16:18 UTC
From: marcos dot guerrero at isastur dot com Assigned: cmb (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 7.1.11 OS: Windows 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marcos dot guerrero at isastur dot com
New email:
PHP Version: OS:

 

 [2017-11-14 11:41 UTC] marcos dot guerrero at isastur dot com
Description:
------------
PHP 7.1.11 nts x64
Pecl ssh2 7.1 1.1.2 nts x64 (although it happens with 1.0, 1.1, 1.1.1 as well)

When I try to set stream_set_timeout to the resource given by ssh2_exec it fails with:
 PHP Warning:  stream_set_timeout(): No support for ssh2 stream timeout. Please recompile with libssh2 >= 1.2.9

But the phpinfo shows 

ssh2

SSH2 support => enabled
extension version => 1.1.2
libssh2 version => 1.7.0
banner => SSH-2.0-libssh2_1.7.0


So I think 1.7.0 is >= 1.2.9 
Why is it complaining about the version then 


Test script:
---------------
$session = ssh2_connect('localhost', 2222);
ssh2_auth_password($session, 'ubuntu', 'ubuntu');
$out = ssh2_exec($session, 'date ; sleep 10s; date');
stream_set_timeout($out, 5);
stream_set_blocking($out, true);
echo stream_get_contents($out);

Expected result:
----------------
The stream_get_contents should return after 5 seconds (and therefore I should get only one date in the output)

Actual result:
--------------
The stream_gets_contents returns after the end of script execution (10 s) and I get the two dates

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-10 16:18 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2021-02-10 16:18 UTC] cmb@php.net
> So I think 1.7.0 is >= 1.2.9 
> Why is it complaining about the version then

Because that is not properly implemented on Windows.
 [2021-02-10 16:27 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #75523: stream_set_timeout(): No support for ssh2 stream timeout
On GitHub:  https://github.com/php/pecl-networking-ssh2/pull/49
Patch:      https://github.com/php/pecl-networking-ssh2/pull/49.patch
 [2021-02-24 21:09 UTC] langemeijer@php.net
Automatic comment on behalf of casper.langemeijer@procurios.nl
Revision: http://git.php.net/?p=pecl/networking/ssh2.git;a=commit;h=6af6094d5977efb7d2a2af727f8bde91cf359026
Log: Merge pull request #49: Fix #75523: stream_set_timeout(): No support for ssh2 stream timeout
 [2021-02-24 21:09 UTC] langemeijer@php.net
-Status: Verified +Status: Closed
 [2021-02-24 21:09 UTC] langemeijer@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=pecl/networking/ssh2.git;a=commit;h=717170e90ee9f33b0d25781b1f07789415599dd3
Log: Fix #75523: stream_set_timeout(): No support for ssh2 stream timeout
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Apr 14 09:01:24 2021 UTC