Thank for your reply BUT the solution you proposed me does NOT apply, because 
eval() is for evaluating strings as if they were codes, moreover the 
somescript.php would have to be readapted : please note that the script takes 
the arguments via argc (commandline arguments). 
Eval() is not suitable for running external (and may be big) script file 
which takes in input the arguments via $HTTP_SERVER_VARS['argv']; 
otherwise I would have used include() !!

The problem is open:  the behaviour that I stated below is very strange... 
could not understand why...


From: "elias" <[EMAIL PROTECTED]>
Date: Tue, 10 Jul 2001 08:45:51 -0700
Subject: Re: exec(), system() and &


why don't try to use eval()

read the PHP file from within your PHP script
and eval the read file,

"Siva Subraj" <[EMAIL PROTECTED]> wrote in message
> 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
> 'infile.txt' and produces 'outfile.txt' .
> BUT, if I take off the ampersand '&'  (ie  I want to exec it and to wait
> 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
> 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!!
> Siva

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