On 29/11/2011 17:16, Daniel Brown wrote:
On Sat, Nov 19, 2011 at 09:33, richard gray<rich@xxxxxxxxxxxx> wrote:
This happens because PHP is writing to STDOUT, of course, and then the
command line redirection grabs that information and puts it into the
file. Unfortunately, by itself, this won't work in the background,
which is why you're getting the SIGTTOU (SIGnal TTy OUput). If you
need to redirect the output and have it run in the background (where
something like file_put_contents() or fwrite() isn't a practical
option), give it a NOHUP (NO Hang-UP): nohup php test.php > test.log &
This will automatically redirect STDERR to STDOUT, save for the
message telling you the same.
Thanks for your reply Daniel unfortunately nohup makes no difference the
script still stops with no output being logged -- and also on a
different machine (Ubuntu) php -f test.php >test.log 2>&1 & -- works
perfectly - seems to be an issue with OSX Lion and the version of PHP
that came with the machine -- I cannot compile my own build of PHP
because of this problem -> https://bugs.php.net/bug.php?id=60268 -- so I
am completely stuck :(
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php