LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-15-2005, 04:28 AM   #1
rome
LQ Newbie
 
Registered: Nov 2005
Posts: 3

Rep: Reputation: 0
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 !
 
Old 11-15-2005, 09:12 AM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
execute shell command inside of c code? khucinx Programming 6 10-26-2010 09:30 PM
PHP can't execute shell command ! rome Programming 3 11-15-2005 12:46 PM
php/max time exceeded/execute via shell? jdc32 Linux - Software 0 01-31-2005 05:22 AM
cannot execute 'cd /' shell command from PL/SQL.... samyakm Linux - Newbie 1 01-03-2005 10:10 AM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration