millsoft
7/25/2017 - 3:16 PM

Run php script in own thread without blocking the caller

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);