$connection=ssh2_connect('Ip address', 22);
ssh2_auth_password($connection, 'username','password')
$sourceFilePath = 'some remote file path';
$destinationFilePath = '/var/cliscripts/sample.txt';
$fileTransferStatus = ssh2_scp_recv($connection, $sourceFilePath, $destinationFilePath);
以下代码用于将远程文件复制到本地目录,但是出现了无法打开错误的本地目录文件:
Permission denied, Unable to write to local file
答案 0 :(得分:0)
我已向文件夹
授予apache权限chown -R apache2 / var / cliscripts /