php apache root write permission
Can i write /etc/apache2/ directory. I want to create a file with php and apache.开发者_如何学运维 But i must root. Is there a way to sudoers?
Can do this?
You can change the group of /etc/apache2 to the same group that apache runs as and give the group write permission. This might be safer than trying to su with php and a system call.
Any directory that you want the Apache process to write to needs to be writable by the user that the Apache daemon runs as. So you either need to make the directory world-writable (ie chmod 777) or owned by the Apache user.
精彩评论