Pc_Madness Posted May 6, 2008 Share Posted May 6, 2008 Hey guys. I'm doing a little "restore" feature for my website in PHP, basically it has to extract a copy of itself from a tar.gz file, which I am doing like thus, $command = "tar xvzf backup/Core.tar.gz"; exec($command); and it all works fine, cept I then don't have permission to edit the files afterwards as they belong to 'www-data'. I could run it using sudo, but it doesn't seem to give me an option to enter a password. (I'm not really bothered about hard coding the password) Is there an easy way to solve this? I spose once I've actually finished with the site I won't need to edit it anymore so it won't be a problem, but during testing its going to be a pain. Thanks! :) Link to comment Share on other sites More sharing options...
GatorV Posted May 6, 2008 Share Posted May 6, 2008 man chown :) Link to comment Share on other sites More sharing options...
Pc_Madness Posted May 6, 2008 Author Share Posted May 6, 2008 man chown:) Perhaps I missed it in the manual, but won't I still need to use sudo to run chown? Link to comment Share on other sites More sharing options...
Borbus Posted May 7, 2008 Share Posted May 7, 2008 No because www-data owns the files. The easiest thing to do, though, would be to add yourself to the www-data group and give the files rw permission for group. Link to comment Share on other sites More sharing options...
Recommended Posts