I have a strange problem with the weird behaviour of exec() or system()
Here is it:
When I exec('/usr/local/bin/php somescript.php if=infile.txt of=outfile.txt > out_somescript &');
works perfectly - the script processes infile.txt and produces outfile.txt.
BUT, if I take off the '&' - 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-force-cgi-redirect
--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 go. WHY??
Please let me know.