There is a small demand program that only needs to send the request, the other, no need to receive return information
Reply content:
There is a small demand program that only needs to send the request, the other, no need to receive return information
Use Curl.
Curl can post some parameters to the specified path, the concrete instance, can parameter Php curl function
With file_get_contents (' http://baidu.com ') The simplest, more complex can be used with curl or fsockopen
In fact, you want the demand is: Send the request, do not block your current process
You Baidu php asynchronous task start
Common solutions include Redis publish/subscribe, Gearmand, etc.
My own more complex, PHP with sockets and Nodejs for high-speed communication (tell Nodejs to perform what task), Nodejs again as consumer and RABBITMQ communication, so you also say not clear.
The principle is that the current PHP is not responsible for initiating HTTP requests, is only responsible for notifying what to do, let a special program to perform the request task
do_something();// 告知后台执行请求任务, 几乎不占用时间就立马执行 next();do_backend("send_request", "http://www.baidu.com"); // 接着做其它东西next();
Worker side (task execution side, can be PHP program, or other language program)
// 异步监听任务subscribe("send_request", function($url){ file_get_contents($url); // 或 curl});