Hi, I have a mail script to that will take a long time to process, let me call it form2.php Now i post from form1.php to form2.php. I like to run the form2.php in the background so that the user will not wait for executing the form2.php. I have used exec and shell_exec but not success. I am using latest WAMP server in my local mechine. Thanks
If you have cURL enabled, fork a background process using exec which will complete the process and you can happily give message to the user saying his request is queued
Hi nayanjyotionline, i was had the exact problem a while ago. And manage to fix it. Anyway it's a long detail, and i have write an article, see it here: http://www.ivankristianto.com/web-d...p-process-upon-closed-client-connection/1438/ basically i set no timeout and output buffering, so the php process will run until it is finished, even the client close the connection. Good luck
cron can serve the purpose very well if the process is not time based, as in it need not run immediately the user submits request OR if batch processing is not an issue. But the case mentioned seems to require a background process fork.