For example:
//test.php
#! /usr/local/php/bin/php
<?php
exec('nohup ./loop.php > loop.out');
echo 'I am a superman!';
//loop.php
#! /usr/local/php/bin/php
<?php
$count = 0;
while (true) {
echo "Loop count:{$count}\n";
$count++;
}
When I run ./test.php I can not get the output 'I am a superman!', as you know loop.php is an endless loop, test.php is interrupted by loop.php, so how can I get the output? Any help is appreciated.