简体   繁体   中英

Setting permissions in Fedora Apache/PHP

I am building a Fedora server (on VirtualBox right now). It is running Fedora 15.

I want my PHP script to be able to edit the contents of a file in the same folder it is in.

The PHP script and the file are in /home/user/public_html/

But, when I call "file_put_contents("./theFile.txt")" I get an error saying that it cannot open the stream, permission denied.

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 is preventing you from writing out the file. See the httpd_selinux(8) man page for ways to work with/around it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM