Skip to content

Instantly share code, notes, and snippets.

@kasperhartwich
Last active December 12, 2015 12:09
Show Gist options
  • Select an option

  • Save kasperhartwich/4769866 to your computer and use it in GitHub Desktop.

Select an option

Save kasperhartwich/4769866 to your computer and use it in GitHub Desktop.
Execute command in background with php. For f.ex multithreading.
<?php
function bg_exec($phpfile) {
exec("nohup php " . $phpfile . " >/dev/null 2>&1 & echo $! &");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment