go to bug id or search bugs for
From manual page: http://www.php.net/function.opendir#refsect1-function.opendir-description
I'm connecting to a Sftp server and try to open a directory on this server. It worked fine on php 5.3.10 and php 5.3.14 but since we upgraded to 5.3.21 it doesn't work anymore, opendir returns false.
$con = ssh2_connect($server, $port);
ssh2_auth_pubkey_file ( $con, $login, $pubKeyFile, $privKeyFile);
$sftp = ssh2_sftp($con);
$dir = "ssh2.sftp://$sftp/";
the directory resource
Add a Patch
Add a Pull Request
This is discussed at http://stackoverflow.com/a/16238476/69173, which notes that you can work around the issue by appending an explicit current-directory period.
I'm willing to try to create a patch for this. It'll be a little tough to write a test case for it, though--should I include a reference to a public sftp share?
This ticket may belong under PECL->SSH2 rather than directory functions.
I've done a build of 5.6.0-dev head with ssh2 0.12 and confirmed that this bug is still present.
To clarify, this issue specifically affects the root directory, if Michael and I are seeing the same thing. Subdirectory listing works fine.
Bug still exists with PHP 7.2.6 and SSH2 PECL Plugin 1.1.2-alpha
Possible Workaround still is to appending a dot (.) to the root directory.