views:

23

answers:

1

Hi people,

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  A: 

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

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