title: Allowing PHP to change file and directory ownership and permission
body: <p>I'd like to build a simple web app, which manages some directory on a server. I want to give people the option to use chown and chmod.</p>
  
  <p>What is the safest way to give PHP this permission? The quickest thing is just running Apache and PHP as root, but that doesn't seem to be a smart idea.</p>
  
  <p>One other thing I thought of, was creating a separate script which has setuid root..</p>
  
  <p>Thanks!</p>