How to stay in a Curl connection/request with PHP?

Asked

Viewed 16 times

-1

Why does the connection to my code close? I didn’t write in the code to close it, I would like it to remain open. Sorry anything I’m new, but I want to make a request/GET connection with a url, and that it did not close, remain open or connected for 1 hour, I did the following code:

// URL para onde será enviada a requisição GET
$url = "https://meusiteaqui";

// Inicia a sessão cURL
$ch = curl_init();

// Inicia conexão
curl_setopt($ch, CURLOPT_URL, $url);
  • Please clarify your specific problem or provide Additional Details to Highlight Exactly what you need. As it’s Currently Written, it’s hard to Tell Exactly what you’re asking.

  • Welcome to Stack Overflow! Please explain the problem better, and if possible include a example of code that reproduces what is happening, because your question is not noticeable. See Help Center How to Ask.

  • But what’s the point of keeping a request open?

  • What are the parameters CURLOPT that have been defined? (I suggest you see [Mre]) 'cause if there’s anything like RETURN_TRANSFER when storing all data the connection is obsolete, if there are no notes (Locations) it closes yes, but what would be the need to keep open?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.