开发者

php apache root write permission

开发者 https://www.devze.com 2023-01-18 06:13 出处:网络
Can i write /etc/apache2/ directory. I want to create a file with php and apache.开发者_如何学运维 But i must root.

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

精彩评论

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