exec('php convert.php >> convert.log &');
This is the sample code I found, but here's what I want to do.
Run convert.php with 1 or more POST variables.
Execute the function in the background in case the user leaves our website.
Run multiple instances of convert.php in the background in case more than 1 user on the site at one time.
You do not need to execute the process in another process just to ensure that it continues to run. PHP has a built in feature for that.
ignore_user_abort() if true the current script will finish even if the user leaves while it's running.
Edit: as pointed out in comment you also need to disable time limit. Use set_time_limit(0)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.