ssh2_scp_recv(remote_file,localfile):无法打开流:权限被拒绝

时间:2014-01-23 12:16:38

标签: php ssh

$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

1 个答案:

答案 0 :(得分:0)

我已向文件夹

授予apache权限

chown -R apache2 / var / cliscripts /