After filling out the html формы , the user is transferred to the "Спасибо" page on it, various mailing functions are started, there are many of them, and they can be sent for about 2-х минут. The problem is that after clicking the submit button, the user НЕ перебрасывает on the "Спасибо" page until the scripts are completed.

Can I somehow immediately transfer the user to the "Thank you" page and then run the scripts? Thank you in advance!

    1 answer 1

    1. either implement the queue - Mysql table or RabbitMQ, pull the crown.

    2. or run a copy of the script passthru ('(php -f' .PATH_DIR.'your_script.php &) >> / dev / null 2> & 1 '); but for this, of course, the rights should be at the web user

    • It seems that RabbitMQ is really the right option than crutches in the form of running scripts in the background with the impossibility of normal execution monitoring and error handling. You can still look in the direction of ZeroMQ. - zalex
    • thanks, I will understand, for that noob like me it is certainly not easy) - Sergey Kozin