Re: PHP script won't run in the background
| From: | Richard Quadling | Date: | Mon, 21 Nov 2011 17:14:07 +0000 |
| Subject: | Re: PHP script won't run in the background | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-315785@lists.php.net to get a copy of this message | ||
On 19 November 2011 14:33, richard gray <rich@richgray.com> 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
>
>
I've seen this ...
php script.php 1>nul 2>nul
Not sure how effective it is. But the code is tagged as a "fire and
forget" mechanism.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc : Fantasy Shopper
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
fan.sh/6/370