Link to home
Start Free TrialLog in
Avatar of wjdashwood
wjdashwood

asked on

Decompressing archive and setting files' owner

I'm creating an install program which needs to decompress an archive and make sure all files extracted are set to the hosting account owner which is proving harder than I thought! It's my own server and only running code which I control and so I'm using apache/mod_php rather than php as CGI/FastCGI etc although I'm considering the those options given the hassle of this.

At the moment I'm using PclZip to decompress a zip file and therefore the files extracted are owned by "apache" group/user. I then tried to use chown() and chgrp() to change the file/folder ownership/group but I get the error message "Operation not permitted" for both functions.

Surely there must be an easier way to do this? Thanks in advance for any help!
ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wjdashwood
wjdashwood

ASKER

Tried that and afraid that doesn't work but I think there may have been an error in the code I used original using PHP's own chown() and chgrp() functions so I'll go back and try that if there isn't an alternative.

Cheers