Если вы работаете в Windows, вы можете использовать curl_multi:
// create cURL resource
$ch = curl_init();
// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://domain/path/to/script");
curl_setopt($ch, CURLOPT_HEADER, 0);
//create the multiple cURL handle
$mh = curl_multi_init();
//add the handle
curl_multi_add_handle($mh,$ch);
// execute the handle
curl_multi_exec($mh,$running);
Но если вы работаете в Linux, вы можете также выполнить форк:
$pid = pcntl_fork();
if ($pid == -1) {
die('could not fork');
} else if ($pid) { // mother process
// continue doing stuff here
echo 'Child labor ';
echo 'is acceptable ';
echo 'in programming';
// wait for the child to finish
pcntl_wait($status);
} else { // child process
// do big loop here
while (...) {
sleep(1000);
}
}