LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP can't execute shell command ! (https://www.linuxquestions.org/questions/programming-9/php-cant-execute-shell-command-383277/)

rome 11-15-2005 04:28 AM

PHP can't execute shell command !
 
Hello world,
I've installed my PHP application on a remote server with Debian Linux and
plesk 7.5 reloaded, my assigned php-user is www-data (instead of the default "apache") and every command that I call with "exec" or "shell_exec" or "system" return the error code 127.

if I enter the shell as root I can do anything but
whenever I type "su - www-data" the return is "no shell"

So I don't know wether this is caused by some php configuration directives or OS user permissions settings.

who knows debian and plesk ? who knows this problem ?
my server administrators don't know how to resolve this issue.

help me ! :cry:

graemef 11-15-2005 09:12 AM

The problem is caused by a lack of permissions for the user. The user will need to be given the permission to execute the shell scripts that you talk about. When you set up the user you may want to set up a login shell so that you can test the users access but for the script itself you will need to ensure that the www-data user has the execute permissions. This can be done by either making the user the owner of the script, or a member of a group that has the required permissions (I'd refrain from making it world executable!)

all the best,

graeme.


All times are GMT -5. The time now is 01:40 PM.