简体   繁体   中英

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.

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