exec() problem
Posted: Wed Feb 18, 2009 10:26 am
I'm trying to execute an exec() command from within PHP and its giving me permission denied.
the command is exec('chown ftpuser:ftpgroup /home/ftp/ -R');
- It returns "Operation not permitted"
changing ownership of `/home/ftp/': Operation not permitted
- Apache runs under user "geuze"
geuze 14990 10067 0 07:11 ? 00:00:05 /usr/sbin/httpd
- The /home/ftp dir is owned by user geuze ,group geuze
drwxr--r-- 2 geuze geuze 4096 2009-02-17 19:29 ftp
- selinux has been disabled
getenforce returns "Disabled"
- exec('whois') returns "geuze" so the webserver is running as geuze
- if i login as "geuze" and issue the chmod command it works
- if i run the php script (with the exec code) from the command line it also works, running the same script through the webserver fails.
- in php.ini
safe_mode = Off
safe_mode_gid = Off
- fedora 10 , php 5.2.6-5
I dont know what to check anymore, what could prohibit me from executing this chown command from php?
the command is exec('chown ftpuser:ftpgroup /home/ftp/ -R');
- It returns "Operation not permitted"
changing ownership of `/home/ftp/': Operation not permitted
- Apache runs under user "geuze"
geuze 14990 10067 0 07:11 ? 00:00:05 /usr/sbin/httpd
- The /home/ftp dir is owned by user geuze ,group geuze
drwxr--r-- 2 geuze geuze 4096 2009-02-17 19:29 ftp
- selinux has been disabled
getenforce returns "Disabled"
- exec('whois') returns "geuze" so the webserver is running as geuze
- if i login as "geuze" and issue the chmod command it works
- if i run the php script (with the exec code) from the command line it also works, running the same script through the webserver fails.
- in php.ini
safe_mode = Off
safe_mode_gid = Off
- fedora 10 , php 5.2.6-5
I dont know what to check anymore, what could prohibit me from executing this chown command from php?