Run php script in own thread without blocking the caller
<?php $cmd = 'nohup nice -n 10 php -f longprocess.php > log_from_caller.txt & printf "%u" $!'; $pid = shell_exec($cmd);