To run any background process from PHP you can simply use the exec() or shell_exec() functions. Adding a ‘&’ at the end causes the process can run in the background. Create the php file to be executed Put the php code you want to run in the background in a file called, for example, ‘my_background_task.php’ […]
Category: Threads
Manually trigger cron
spawn_cron() sends a request to run WordPress cron but doesn’t halt page loading.
Prevent PHP function being run on different threads
Using directory approach
Return HTTP response before continuing
Return HTTP 200 response before continuing processing