I am trying to run php CLI script in the background and it just won't work - it has Stopped SIGTOU status (trying to write output). Here are the details
- Mac OS X Lion 10.7.2
- PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep 8, 2011 19:34:00)
I created a basic script test.php
<?php echo 'Hello world'.PHP_EOL; ?>
Here are the results of various tests: -
php -f test.php (Hello, the world is being displayed)php -f test.php >test.log 2>&1 (Hello world gets into test.log)php -f test.php >test.log 2>&1 & --- I get [1]+ Stopped(SIGTTOU) php -f test.php > test.log 2>&1 - and the task just sits there, not writing anything but lsof shows that the log file is open.
Is this somehow related to PHP? A similar shell script does not perform any problems in the background.
source share