如何在 php 中更改目录的文件写入权限?

问题描述 投票:0回答:0

我有一个 php 脚本

 $savefile = fopen('C:\Users\Dell\Desktop\Final\images' ,'w');
        fwrite($savefile, $image);
        fclose($savefile);

但是出现这个错误

PHP 警告:fopen(C:\Users\Dell\Desktop\Final\images):无法打开流:第 85 行 C:\Users\Dell\Desktop\Final\main.php 中的权限被拒绝 PHP 致命错误:未捕获的类型错误:fwrite():参数 #1 ($stream) 必须是资源类型,布尔值在 C:\Users\Dell\Desktop\Final\main.php:86

我已经检查了权限

echo fileperms('C:\Users\Dell\Desktop\Final\images');

输出是

16895

这里有什么问题吗?

是权限吗?需要改吗?

或其他什么?

php file-permissions
© www.soinside.com 2019 - 2024. All rights reserved.