问题描述
我正在尝试在远程服务器上读写文件,但是我只能检查它是否存在:
<?PHP
echo 'test';
set_include_path('/mnt/vpn');
$dst = "/mnt/vpn";
echo $dst,file_exists($dst) ? ' exists' : ' does not exist',"<br><br>";
echo $dst,is_readable($dst) ? ' is readable' : ' is NOT readable',is_writable($dst) ? ' is writable' : ' is NOT writable',"<br><br>";
$fh = fopen($dst,'r',1);
if ( !$fh ) {
echo ' last error: ';
var_dump(error_get_last());
} else {
echo $fh;
}
?>
这是错误日志:
test/mnt/vpn exists
/mnt/vpn is NOT readable
/mnt/vpn is NOT writable
Warning: fopen(/mnt/vpn): Failed to open stream: Permission denied in /var/www/html/test.PHP on line 11
last error: array(4) { ["type"]=> int(2) ["message"]=> string(57) "fopen(/mnt/vpn): Failed to open stream: Permission denied" ["file"]=> string(22) "/var/www/html/test.PHP" ["line"]=> int(11) }
当我尝试对本地路径执行相同操作
我正在使用WinSCP
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)