Re: [PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Richard Lynch
On Mon, August 14, 2006 12:25 pm, Michael Jonsson wrote: > I can run any external program like ls, cp, uptime... > But if a try to run my shell script a get error. > > $passwdexe = "sudo /usr/bin/webpasswd"; > $user=$_POST[name]; > $passwd="$passwdexe $user 123456"; >

Re: [PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread p . willis
Quoting Adam Zey <[EMAIL PROTECTED]>: > > Looking at your $command, there is no path in front of it. It's likely > that PHP's shell doesn't have the program in its PATH. Try manually > specifying the full path to the command: > > $command="/home/peter/myprog $arg1 $arg2 > textfile.txt"; > > (

Re: [PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread p . willis
Yes, that is a similar problem and sounds very much like what I am experiencing. Peter Quoting Michael Jonsson <[EMAIL PROTECTED]>: > Hi, > > I can run any external program like ls, cp, uptime... > But if a try to run my shell script a get error. > > $passwdexe = "sudo /usr/bin/webpa

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Michael Jonsson
No, it not on... safe_mode Off Off safe_mode_exec_dir no valueno value safe_mode_gid Off Off safe_mode_include_dir no valueno value .M Adam Zey wrote: Michael Jonsson wrote: Hi, I can run any external program like ls, cp, uptime... But if a try to run

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Adam Zey
Michael Jonsson wrote: Hi, I can run any external program like ls, cp, uptime... But if a try to run my shell script a get error. $passwdexe = "sudo /usr/bin/webpasswd"; $user=$_POST[name]; $passwd="$passwdexe $user 123456"; echo $passwd; $result = s

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Michael Jonsson
Hi, I can run any external program like ls, cp, uptime... But if a try to run my shell script a get error. $passwdexe = "sudo /usr/bin/webpasswd"; $user=$_POST[name]; $passwd="$passwdexe $user 123456"; echo $passwd; $result = system($passwd); Resulta

[PHP] Re: system, exec, shell_exec, passthru

2006-08-14 Thread Adam Zey
[EMAIL PROTECTED] wrote: Hello, I am trying the run an external application with command line arguments using PHP under linux. ie: $command="myprog $arg1 $arg2 > textfile.txt"; system("echo \"$command\" > test.txt"); system($command); $handle=fopen("textfile.txt","r"); if($handle!=NULL) {