ssh2_scp_send() 函数挂在 php 中。这是代码:
$debug_line_feed = "\n";
$conn = ssh2_connect($sftp_server, 22);
$return = ssh2_auth_password($conn, $sftp_user_name, $sftp_user_pass);
if ($return===true) echo "successfull connection".$debug_line_feed;
echo "uploading file".$debug_line_feed;
$local_filename = $product_feed_file_with_path;
$remote_filename = 'product_feed.txt';
ssh2_scp_send($conn, $local_filename, $remote_filename);
echo "successful".$debug_line_feed;
当我运行它时,它输出“成功连接”,“上传文件”然后挂起。知道如何解决这个问题吗?
我也尝试使用 ssh2_scp_recv 进行下载,但它也挂起,本地文件被创建为 0 字节文件。