I have a web page that contains a php script that pulls data from an API and stores it in a database. My problem is that the script takes 10 minutes to run and stops if the user navigates away from the page on which it's loading - not ideal!
To solve this I'd like to run/load this page on my server as a background job so that a users can still navigate the site without the site or script hanging.
I've had a look at shell_exec but cant seem to make that work:
<?php
shell_exec("/usr/bin/php http://example.com/data_base_update.php &");
?>
Does anyone know how to trigger a URL on the server, for example http://example.com/data_base_update.php without using a cron job?
Thanks,
Matt