Dear list,

I have a strange problem with the weird behaviour of exec() or system()

When I do:
exec('/usr/local/bin/php somescript.php if=infile.txt of=outfile.txt > 
out_somescript &');

in a script invoked by apache, it works perfectly - the somescript processes 
'infile.txt' and produces 'outfile.txt' .

BUT, if I take off the ampersand '&'  (ie  I want to exec it and to wait for 
it to finish before going ahead),  it does NOT work. I find an empty file 
'out_somescript' and no 'outfile.txt' at all. 

I recompiled php (ELF binary in /usr/local/bin) without 
--enable-safe-mode --enable-discard-path

All files have universal read permission, the directory is writable by apache 
group. There is suExec module.

I also tried system() to make a shell invocation.

The problem persists: with & it's ok, meanwhile without it doesn't execute 
the script.  What is wrong?  Please help me, thanks!!


PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to