关于php使用fopen报错 failed to open stream: Permission denied



andy@AndyMacBookPro:~/Downloads$ ll wz_1223.csv
-rwxrwxrwx  1 andy  staff  42082362 12 23 14:09 wz_1223.csv*
andy@AndyMacBookPro:~/Downloads$



Warning: fopen(/Users/andy/Downloads/wz_1223.csv): failed to open stream: Permission denied in /usr/local/webdata/andy/fanli/job/job1.php on line 16



从这里:http://stackoverflow.com/questions/10376048/fopen-permission-denied-on-a-file-with-777-permissions


看到这句话:

I'll have a look at whether safe mode is enabled. As for the folder, the permissions are also set to 777. – personne3000 May 2 '12 at 16:37



然后我的文件在这里:

/Users/andy/Downloads/wz_1223.csv


我把他mv到/usr/local/webdata/目录下


然后就可以了~~~果然是目录的权限问题。。。



2025/07/09 02:57:16 [error] 10681#0: *22 FastCGI sent in stderr: "PHP message: {"reqId":"rX2QQ4arW1mTELoVwB1L","level":2,"time":"2025-07-08T18:57:16+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/index.php","message":"touch(): Unable to create file /usr/local/var/www/nextcloud/config/config.php because Permission denied at /usr/local/var/www/nextcloud/lib/private/Config.php#262","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36","version":"","data":{"app":"PHP"}}PHP message: {"reqId":"rX2QQ4arW1mTELoVwB1L","level":2,"time":"2025-07-08T18:57:16+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/index.php","message":"fopen(/usr/local/var/www/nextcloud/config/config.php): Failed to open stream: No such file or directory at /usr/local/var/www/nextcloud/lib/private/Config.php#263","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36","version":"","data":{"app":"PHP"}}PHP message: {"reqId":"rX2QQ4arW1mTELoVwB1L","level":2,"time":"2025-07-08T18:57:16+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/index.php","message":"chmod(): No such file or directory at /usr/local/var/www/nextcloud/lib/private/Config.php#266","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36","version":"","data":{"app":"PHP"}}PHP message: {"reqId":"rX2QQ4arW1mTELoVwB1L","level":3,"time":"2025-07-08T18:57:16+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"/index.php","message":"Rendering themed error page failed. Falling back to un-themed error page.","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36","version":"","exception":{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"An exception occurred in the dr 2025/07/09 02:57:16 [error] 10681#0: *22 upstream sent too big header while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080", referrer: "http://localhost:8080/" 2025/07/09 02:57:16 [error] 10681#0: *22 open() "/usr/local/Cellar/nginx/1.27.5/html/50x.html" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080", referrer: "http://localhost:8080/" 2025/07/09 02:57:16 [error] 10681#0: *22 FastCGI sent in stderr: "PHP message: {"reqId":"CVSo2ZXwrXzq9VDOZ61E","level":2,"time":"2025-07-08T18:57:16+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/index.php","message":"touch(): Unable to create file /usr/local/var/www/nextcloud/config/config.php because Permission denied at /usr/local/var/www/nextcloud/lib/private/Config.php#262","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36","version":"","data":{"app":"PHP"}}PHP message: {"reqId":"CVSo2ZXwrXzq9VDOZ61E","level":2,"time":"2025-07-08T18:57:16+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/index.php","message":"fopen(/usr/local/var/www/nextcloud/config/config.php): Failed to open stream: No such file or directory at /usr/local/var/www/nextcloud/lib/private/Config.php#263","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36","version":"","data":{"app":"PHP"}}PHP message: {"reqId":"CVSo2ZXwrXzq9VDOZ61E","level":2,"time":"2025-07-08T18:57:16+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/index.php","message":"chmod(): No such file or directory at /usr/local/var/www/nextcloud/lib/private/Config.php#266","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36","version":"","data":{"app":"PHP"}}PHP message: {"reqId":"CVSo2ZXwrXzq9VDOZ61E","level":3,"time":"2025-07-08T18:57:16+00:00","remoteAddr":"127.0.0.1","user":"--","app":"core","method":"GET","url":"/index.php","message":"Rendering themed error page failed. Falling back to un-themed error page.","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36","version":"","exception":{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"An exception occurred in the dr 2025/07/09 02:57:16 [error] 10681#0: *22 upstream sent too big header while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080", referrer: "http://localhost:8080/" 2025/07/09 02:57:16 [error] 10681#0: *22 open() "/usr/local/Cellar/nginx/1.27.5/html/50x.html" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080", referrer: "http://localhost:8080/
最新发布
07-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值