I have to execute 100+ php scripts to be executed in parallel, each php script insert new data in database and update some previous records.
For example, each script url would be like that:
example.com/update.php?data-from-project-1.com
example.com/update.php?data-from-project-2.com
example.com/update.php?data-from-project-2.com
So on...
And Update page work something like:
Update.php
<?php
//insert some new records from project data
//update some records
?>
I am trying to do:
Cron JOB PAGE:
$urls=array("data-from-project-2.com", "data-from-project-2.com",....)
for ($index = 0; $index < count($urls); $index++) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "update.php?$urls[$index]");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch); }
But i guess this will execute all pages in order and can produce timeout issue as well. Anyway to execute them all in parallel through cron job page. I don't need any output, they just need to update database. Any help would be appreciated. Thanks