0

I need to write an exec to change owner on some folders on my webserver. This is what I am working with.

exec('cd /xxxxx/xxxxxx/public_html/ && chown user.user * -R', $out);

Got to be honest Apache is not my bag so kind of stumbling in the dark. Basically I need to change all directories to user and not 99 as they currently are set to when they are created. The php chown() function has been disabled so Ive got to go old school.

Steve

2
  • How do you create these folders then? It might be a configuration issue on the server if you created them using a PHP script... Commented Aug 16, 2010 at 15:42
  • chown usually not available for common users. You have to re-upload your files to the server. Also, you have to place -R option before user.group. Commented May 17, 2016 at 11:21

1 Answer 1

3

You can't do it, as chown (usually) requires root.

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

2 Comments

+1 A system that allows chown to be executed by non-root would be very insecure.
@win Some unixes allow this, but they clear the setuid and setgid bits. It nevertheless allows bypassing disk quotas.

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.