|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63480 Warning on using the resource inline in the uri.
Submitted: 2012-11-10 13:24 UTC Modified: -
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Assigned:
Status: Open Package: ssh2 (PECL)
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-11-10 13:24 UTC]
Using the resource inline in the uri works, (ie, 
ssh2.sftp://$session/path/to/file) but will throw a "supplied resource is not a 
valid SSH2 SFTP resource in .." warning on things like file_get_contents.

I found this bugreport in a note in the manual, original by stm555 at hotmail dot 

Test script:
$session = ssh2_connect('', 22);
ssh2_auth_agent($session, 'username');

$passwd = file_get_contents("ssh2.sftp://$session/etc/passwd");

Expected result:
There should be no warning when everything is peachy

Actual result:
Warning: file_get_contents(): supplied resource is not a valid SSH2 SFTP resource 
in /home/casper/projects/aaa/ssh2.php


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 21 22:01:23 2020 UTC