Re: PHP script won't run in the background

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2011-11-19 at 23:09 +0800, Laruence wrote:

> $ stty -tostop
> 
> thanks
> 
> On Sat, Nov 19, 2011 at 10:33 PM, richard gray <rich@xxxxxxxxxxxx> wrote:
> > Hi all
> >
> > Hope someone can help me with a weird issue I have...
> >
> > I am trying to run a php CLI script in the background and it just won't run
> > - it has a status of Stopped SIGTOU (Trying to write output) - Here are the
> > details
> >
> > OS
> > Mac OS X Lion 10.7.2
> >
> > PHP
> > PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep  8 2011 19:34:00)
> > Copyright (c) 1997-2011 The PHP Group
> > Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
> >
> > I created a basic script  test.php
> >
> > <?php echo 'Hello world'.PHP_EOL; ?>
> >
> > Here are the results of various tests:-
> >
> > Test 1) php -f test.php  (Hello world gets displayed)
> > Test 2) php -f test.php >test.log 2>&1 (Hello world gets put into test.log)
> > Test 3) php -f test.php >test.log 2>&1 & --- I get [1]+  Stopped(SIGTTOU)
> >      php -f test.php > test.log 2>&1 -- and the job just sits there doing
> > nothing nothing gets logged however lsof shows the log file is open
> >
> > It is something to do with php because a similar shell script gets executed
> > no problems in the background...
> >
> > This has me stumped ... any ideas?
> >
> > TIA
> > Rich
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> -- 
> Laruence  Xinchen Hui
> http://www.laruence.com/
> 


Laruence, while that may be a helpful answer to a few people in the
know, just replying back with a single line like that isn't really going
to help the people who are having this problem. At least explain why you
suggested that, or what it does for those on the list that don't know,
especially as it's not a PHP thing, it's a Unix command thing.

Richard, some more info on the command Laruence mentioned can be found
at http://docstore.mik.ua/orelly/unix/upt/ch12_07.htm which explains it
in more detail.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux