尽管有777个权限,php仍无法打开或写入文件

编程入门 行业动态 更新时间:2024-10-10 02:23:11
本文介绍了尽管有777个权限,php仍无法打开或写入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的php脚本无法写入文件777权限. 我要写的文件是mash.xml

My php script is unable to write a file despide 777 permission. the file i want to write is mash.xml

-rwxrwxrwx. 1 root root 459 May 16 2010 config.xml -rwxrwxrwx. 1 root root 323 May 16 2010 handler.xml -rwxrwxrwx. 1 root root 13908 Mar 15 12:18 mash.xml -rwxrwxrwx. 1 root root 494 May 17 2010 media_audio.xml -rwxrwxrwx. 1 root root 13967 Feb 15 07:40 media_effect.xml -rwxrwxrwx. 1 root root 312 May 16 2010 source.xml

我检查了以下问题: -与文件上传器相同的用户var_dump(get_current_user());显示根"

i checked the following issue : - same user as file uploader, var_dump(get_current_user()); displays "root"

这是Apache日志:

this is apache log :

[error] [client 155.132.8.52] PHP Warning: fopen(/var/www/html/moviemasher_3-1-04/example/save/media/xml/mash.xml): failed to open stream: Permission denied in /var/www/html/moviemasher_3-1-04/example/save/media/php/save.php on line 14

感谢您的帮助

推荐答案

如果启用了SELinux:

If SELinux is enabled:

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/moviemasher_3-1-04/example/save/media/xml/mash.xml"

随意使用正则表达式作为文件名.

Feel free to use a regex for the filename.

更多推荐

尽管有777个权限,php仍无法打开或写入文件

本文发布于:2023-11-02 07:21:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551731.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法打开   权限   文件   php

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!