0

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?

3
  • 2
    are you saying you want a PHP web page program to have write access to its own Apache server's private folders? Ouch. Commented Sep 29, 2010 at 15:24
  • You don't need write access to the apache2 folder to create a php web application. Instead try finding the htdocs folder and put your php file there. Commented Sep 29, 2010 at 15:27
  • @Spudley, i can write apache directory. @erikb i know. Commented Sep 29, 2010 at 15:30

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.