PHP script won't run in the background
| From: | richard gray | Date: | Sat, 19 Nov 2011 14:33:44 +0000 |
| Subject: | PHP script won't run in the background | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-315753@lists.php.net to get a copy of this message | ||
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 openIt 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