Continue processing php after sending http response
P粉029327711
2023-08-27 20:36:33
<p>My script is called by the server. I will receive <code>ID_OF_MESSAGE</code> and <code>TEXT_OF_MESSAGE</code> from the server. </p>
<p>In my script, I will process the incoming text and generate a response using the parameters: <code>ANSWER_TO_ID</code> and <code>RESPONSE_MESSAGE</code>. </p>
<p>The problem is that I'm sending a response to the incoming <code>"ID_OF_MESSAGE"</code>, but the server that sends me the message for processing sets its message to delivered to me (which means So I can send his response to that ID) after receiving http response 200. </p>
<p>One solution is to save the message to a database and create some cron that runs every minute, but I need the response message to be generated immediately. </p>
<p>Is there some solution how to send to server http response 200 and continue executing php script? </p>
<p>Thank you very much</p>
Yes. You can do this: