Jump to content

Open a URL location with timeout


papaface

Recommended Posts

Hello,

I am trying to work with the API for my website.

Basically I need to load a specific url to instigate a series of functions. The API will call back my script later automatically.

 

I am trying to find a reliable way of invoking a given URL so that it starts processing the API file BUT I don't want php to sit and wait until the API has finished doing its stuff.

 

I want to update a field in my database when the API is run.

 

I have tried if (get_headers($url)), but this takes to long.

I have tried if (curl_exec($ch)) with timeout, but this is unreliable as it seems to start counting the moment curl is exec'd rather than the time from when the url is successfully loaded.

I have tried file_get_contents($url), but like curl this is unreliable.

 

Does anyone have any other ideas as to how I could do this?

 

Any help would be appreciated!

Link to comment
https://forums.phpfreaks.com/topic/151781-open-a-url-location-with-timeout/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.