Search code examples
phpmultithreadingjob-control

Does PHP have job control like bash does?


does PHP support something like ampersand in bash (forking)? Let's say I wanted to use cURL on 2 web pages concurrently, so script doesn't have to wait before first cURL command finnishes, how could one achieve that in PHP? Something like this in bash:

 curl www.google.com &
 curl www.yahoo.com &
 wait

Solution

  • Does PHP support something like ampersand in bash (forking)?
    No. See the other answers, though I do point out that the PCNTL extension is UNIX only.

    ...how could one achieve that in PHP?*
    cURL supports running multiple downloads concurrently.