gpt4 book ai didi

php - 无法在 PHP 中打开文件

转载 作者:可可西里 更新时间:2023-10-31 22:13:23 30 4
gpt4 key购买 nike

<分区>

我正在尝试使用 PHP 打开一个文件对于写访问:

$myFile = "all.txt";
$fh = fopen($myFile, 'w') or die("can't open file");

我的浏览器正在吐出:

can't open file

我已经尝试 chmod -R 777 这个 PHP 文件所在的文件夹以及 $myFile(一个文本文件)所在的文件夹。还有什么问题?

结果是当我打开错误报告时出现权限错误。当我执行 ls -la all.txt 时,我得到 -rwx------ 1 Myname staff 0 Nov 8 15:11 all.txt

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com