Arm*_*man 2 php apache macos fopen file-permissions
我在我的笔记本电脑上运行PHP脚本updreading.php(使用Mac OS X 10.6.7).这是updreading.php的内容
<?php
$outFile = "examples-output.txt";
$out = fopen($outFile, 'w') or die("can't open write file");
?>
Run Code Online (Sandbox Code Playgroud)
当我运行它时,我得到"无法打开写文件"错误消息.我认为它应该与权限有关.我让自己(arman)成为/ Library/WebServer/Documents /的拥有者,具有读写权限和'应用设置到封闭的项目'.我写的脚本和文件(examples-output.txt)位于/ Library/WebServer/Documents/wabun /中.以下是/ Library/WebServer/Documents/wabun /中文件的权限:
-rw-r--r--@ 1 arman admin 0 May 1 01:03 examples-output.txt
-rw-r--r--@ 1 arman staff 1657 May 1 01:04 updreading.php
Run Code Online (Sandbox Code Playgroud)
我试图在过去4个小时内解决问题,尝试不同的权限而没有运气.伙计们,如何解决这个问题?谢谢!
我遇到了同样的问题.我必须确保所有父文件夹的权限都是正确的.例如,如果(在OSX中)尝试写入目录
~/foo/bar/baz,我用命令解决了它chmod -R 777 ~/foo.
| 归档时间: |
|
| 查看次数: |
10927 次 |
| 最近记录: |