PHP 7 SSH2.SFTP stat() bug work around
问题 I have an app the uses an SFTP connection to download files. It was working correctly in PHP 5.6, not so much in PHP 7. The error I get is as follows: PHP Warning: filesize(): stat failed for ssh2.sftp ... My code is as follows: public function retrieveFiles($downloadTargetFolder,$remoteFolder = '.') { $fileCount = 0; echo "\nSftpFetcher retrieveFiles\n"; $con = ssh2_connect($this->host,$this->port) or die("Couldn't connect\n"); if($this->pubKeyFile){ $isAuth = ssh2_auth_pubkey_file($con,