Call another PHP script and return control to user before the other script completes

前端 未结 4 2071
情话喂你
情话喂你 2020-11-30 14:50

I\'m actually trying to apply this to a script that sends email. The sending email part takes a few seconds which is too long. What I want is for the first script to do its

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 14:59

    Other solution :

    • Your script put a token somewhere (DB/filesystem) when a mail needs to be sent (token may contain data for mail generation)
    • A daemon (can be written in php) runs in the background looking for tokens and "eats" them to send mail

    I use this kind of solution quite a lot ...

提交回复
热议问题