在Fedora中的Apache设置权限/ PHP [英] Setting permissions in Fedora Apache/PHP
问题描述
我建立一个Fedora的服务器(在VirtualBox的现在)。它运行Fedora 15。
I am building a Fedora server (on VirtualBox right now). It is running Fedora 15.
我希望我的PHP脚本能够编辑文件的内容是在同一个文件夹中。
I want my PHP script to be able to edit the contents of a file in the same folder it is in.
PHP脚本和文件都在/ home /用户/的public_html /
The PHP script and the file are in /home/user/public_html/
但是,当我打电话的file_put_contents(./ theFile.txt)我得到一个错误,指出它无法打开流,权限被拒绝。
But, when I call "file_put_contents("./theFile.txt")" I get an error saying that it cannot open the stream, permission denied.
所以,我有:结果
- 制造文件的权限0777结果
- 取得了文件夹的权限0777结果
- 增加了阿帕奇用户到组轮结果。
- 改变了用户的文件夹权限0771.结果
- 改变了的public_html文件夹的所有者和文本文件阿帕奇:阿帕奇。
So, I have:
- Made the file permissions 0777.
- Made the folder permissions 0777.
- Added the "apache" user to the group "wheel".
- Changed the user folder permissions to 0771.
- Changed the owner of the public_html folder and the text file to "apache:apache".
我在我束手无策,我有想法下一步怎么办。建议?
I am at my wits end and I have idea what to do next. Suggestions?
推荐答案
SELinux的是preventing你写出来的文件。办法一起工作/周围见 httpd_selinux(8)
手册页。
SELinux is preventing you from writing out the file. See the httpd_selinux(8)
man page for ways to work with/around it.
这篇关于在Fedora中的Apache设置权限/ PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!