I am working in the Laravel framework where I am using shell_exec()
. I am creating the string of command as in the following example.
$cmd = "php artisan serve:setup";
$resp = shell_exec($cmd);
How can I put a name to the above command? It shows in the system monitor as only "php"; I have multiple commands like this. I need to access the PID
of that command and also the status of that command.
The command is running successfully, and in the system monitor, it shows the process name as "PHP".
I need process name with exec()
or shell_exec()
from PHP.
I have tried like this:
$cmd = "bash -c exec ServerCPP -a cd $path && php artisan serve:setup 2>&1";
$resp = shell_exec($cmd);
dd($resp);
It gives the error: "Could not open input file: artisan."