cURL waiting/timeout

I have cURL working, it retrieves data from Google and what not…
I’m still learning this, so I’m a bit confused about waiting on response and timeout.

Let’s say I’ve some php code, then cURL execute, and then some php code.
So,


php code .... (1)
cURL execute
php code .... (2)

Will php code (2) wait until cURL execution is done and I have gotten a response from Google? OR will the php keep executing php code (2)? If php will keep executing php code (2), what can I do to stop it until I have gotten response from the cURL execute? Thanks! :slight_smile:

I just tried it with non-existent website, and it seemed to wait a long time until giving up, so does this mean it’ll always wait for data?

  1. check if curl extension is activated on your server
  2. check if the site you are parsing accepts curl requests (some sites can block some localhost/proxys/other domains incoming requests)

I’m pretty sure it will wait until the cURL request is complete before continuing. The only way to get around this (That I know of.) would be to set up a separate thread for the cURL process. And I’m not even sure if PHP can do that.

It waits! :slight_smile:

Yay! I guess. :expressionless: