Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP triggers web and logic at the same time

Tags:

php

I want to send a web page to the browser. At the same time, it will run another php script in the server without affecting the browser web page.

Is there any way to achieve this by php and jquery only?

ps1 My script is a heavy task, so I am not sure if it will delay the web page sending or not.

like image 271
BLAdam Avatar asked Apr 29 '26 00:04

BLAdam


1 Answers

i would do it like this

exec("nohup php otherphpscript.php  >/dev/null 2>&1 &");

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!