Skip to content
Advertisement

PHP: how to start a detached process?

Currently my solution is:

JavaScript

and in file.php

JavaScript

is there any way I can do this just with exec?

Advertisement

Answer

No, detaching can’t be done with exec() directly (nor shell_exec() or system(), at least not without changing the command, and using third-party tool which does detach).


If you have the pcntl extension installed, it would be:

JavaScript

Call it like this:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement