|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-01-12 23:33 UTC] ziggi at ziggi dot pl
Description:
------------
'php_ssh2-1.0-7.1-nts-vc14-x64' is erratic compared with 'php_ssh2-1.0-7.0-nts-vc14-x64'.
At least this is working wrong in case of the PHP 7.1 release:
is_dir('ssh2.sftp://' . ssh2_sftp(ssh2_connect($host, $port)) . '$absolute_path_to_remote_directory')
Resolution:
In case of a valid folder with appropriate permissions:
php_ssh2-1.0-7.0-nts-vc14-x64 returns 'true' while
php_ssh2-1.0-7.1-nts-vc14-x64 returns' false'
This has been found while using PHPLOY (https://github.com/banago/PHPloy) on my Windows 10 x64 Pro system using PHP 7.0 (NTS) x64 and PHP 7.1 (NTS) x64 - both VS14 compliations.
Test script:
---------------
is_dir('ssh2.sftp://' . ssh2_sftp(ssh2_connect($host, $port)) . '$absolute_path_to_remote_directory');
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 14:00:01 2025 UTC |
Exakt same Issue with PHP 7.1.2 (SSH-2.0-libssh2_1.4.2) Worked fine with php 5.6.23 (SSH-2.0-libssh2_1.4.2) System is a Debian 7 my workaround is: $streamCheck = ssh2_exec($this->getSshConnection(), 'test -d '.escapeshellarg($folder).' && echo 1 || echo 0'); stream_set_blocking($streamCheck, true); $streamCheck_out = ssh2_fetch_stream($streamCheck, SSH2_STREAM_STDIO); before it was: is_dir('ssh2.sftp://'.$this->getSftpConnection().$folder) -> this returns now always false