I have now searched everywhere and tried all the tips nohup, curl, socks,.... My PHP script waits all the time until it is finished.
I want to run a PHP script that has a 20 second pause, and don't want the user to have to wait.
My last attempt was a shell script
#!/bin/bash
curl -X POST -F 'name=linuxize' -F 'email=linuxize@example.com' https://mySite/test.php > /dev/null 2>&1 &
When I start this in the console I can immediately continue working despite the 20 seconds pause in test.php
Now when I run the shell script in PHP (with and without nohup) PHP always waits the 20 seconds.
$your_command = '/path/to/test.sh';
shell_exec($your_command . " 2>/dev/null >/dev/null &");