I have searched this forum and found several posts relating to Linux, php, and the use of the exec() and shell_exec() commands. However, I have not found a solution that will work.
As stated, I am using Linux (most recent stable ver ... cant remember ver), php 5, apache server. I am trying to execute a php script that will NOT stop the main php program from executing. That is, i want to call the proper function (exec() or shell_exec() ... not sure which) and the program throws that to the command line and moves on to the next, not pausing to wait for the return of the executed command.
I am running script.php which contains ...
$_dummy = exec("php /mnt/notif/external.php 4 5 abc 7 xyz");
This waits for execution and I have tried
$_dummy = exec("php /mnt/notif/external.php 4 5 abc 7 xyz &");
This waits as well ... I have tried
$_dummy = exec("php /mnt/notif/external.php 4 5 abc 7 xyz 1>/dev/null 2>/dev/null");
This waits as well. I am at a loss. Oh ... and I have tried the above with a space and an ampersand on the end. The script called runs properly when called from the command line.
To begin with, should I use exec() or shell_exec()? Then what would the command be to NOT wait for the return from the called script? Any help is greatly appreciated!
Bill