开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜