I’m trying to process a file in the background with the following command, but it does nothing.
exec("php csv.php $file $user > /dev/null &", $output);
If I remove > /dev/null & then the file processes, but not in the background.
exec("php csv.php $file $user", $output);
Any ideas?
Note:
If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends.
http://php.net/manual/en/function.exec.php
so: