ssh2_scp_recv
和ssh2_scp_send
始终返回以下错误:
Severity: Warning
Message: ssh2_scp_send(): Failure creating remote file: Unexpected channel close
Severity: Warning
Message: ssh2_scp_recv(): Unable to receive remote file
当我连接到我的Windows sftp文件服务器OpenSSH for windows 7.3p1-1时 客户端也是一个Windows php iis环境与php ssh2 0.12 x64 for windows
$connection = ssh2_connect("myserver.com", 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
$sftp_send = ssh2_scp_send($connection, "$_upload_path"."myfile", "$_remote_folder_path/myfile", 0644 );
$handle = opendir("ssh2.sftp://{$sftp}{$_remote_folder_path}");
while (false != ($entry = readdir($handle))){
if ($entry == "." || $entry == "..")
continue;
echo $entry;
$sftp_recv = ssh2_scp_recv ($connection, $_remote_folder_path."/".$entry , $_download_path.$entry );
}