So I found a function from http://php.net/manual/en/function.exec.php
function execInBackground($cmd) {
if (substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}
else {
exec($cmd . " > /dev/null &");
}
}
Windows Usage:
pclose(popen('start /B php path/to/background_cron.php', 'r'));
Unix Usage:
exec('php path/to/background_cron.php >> path/to/background_error.log &')
But when these lines are called nothing actually happens (after waiting 5 or so minutes). Am I doing something wrong? prior to these lines being activated I have a file_exists checking if my path/to/background_cron.php exists and it if it doesn't it will return a error.
On the live unix server all the folder permissions are set to write,read,execute for owner,group,public (0755) and file permissions are set to read for owner,group,public (644). The background_log comes up empty after the unix command runs, it creates 4 new blank lines (\n) but doesn't return any expections