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


i'm trying apply script sends email. sending email part takes few seconds long. want first script stuff , trigger script (which sends email), want first script return control user without waiting second script send email.

options have considered:
cron job: i'll have have cron job run every 2 mins. not feasible!
php script activating cron job deactivates when done: ok, how do this? can php this?

you can call shell , manually call php file. no cron required , no waiting.

http://www.php.net/manual/en/function.exec.php

from notes section

"if program started function, in order continue running in background, output of program must redirected file or output stream. failing cause php hang until execution of program ends."


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -