且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

触发(多个)curl请求,不要等待响应(PHP)

更新时间:2022-04-11 05:25:36

我不了解您的特定设置,但是您可以创建一个脚本,该脚本使用bash脚本在后台运行PHP脚本,例如这个:

I'm not privy to your particular setup, but you might be able to create a single script that runs your PHP scripts in the background with a bash script like this:

nohup php /path/to/script.1.php &
nohup php /path/to/script.2.php &
nohup php /path/to/script.3.php &

最后的与号告诉它在后台运行脚本. "nohup"命令告诉它忽略任何挂断信号,以确保即使用户注销该脚本也将继续运行.

The ampersand at the end tells it to run the script in the background. the "nohup" command tells it to ignore any hangup signal, ensuring the script will continue running even if the user logs out.