I execute a bash script from php with shell_exec. But the php script waits until the shell script is finished.
Can I somehow call the bash script without waiting. Both:
exec
shell_exec
are waiting until the bash script is finished. I'm running linux btw.
This has to work:
exec('/your/command /dev/null 2>/dev/null &');
when calling your bash script append & so it will run in the background that's the easiest way if you don't need any output
shell_exec("/bin/bash /path/to/script.sh &");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With