skip to Main Content

I bought a jobs portal script, I’ve successfully installed it and when I try to register I get this error:

cURL error 28: Connection timed out after 2013 milliseconds (see
http://curl.haxx.se/libcurl/c/libcurl-errors.html)

I asked support and they said:

you need to increase read_timeout and timeout. The error is clear, you
don’t have enough time to get the response. increase time in php.ini

I tried increasing max_execution_time, default_socket_timeout in php.ini both to 500, but I’m getting the same error. Then I tried manually adding read_timeout=500 and timeout=500 and again the same error.

What should I do?

3

Answers


  1. CURLE_OPERATION_TIMEDOUT (28)

    Operation timeout. The specified time-out period was reached according to the conditions

    You can set the total time of the cURL transfer using:

     curl_setopt($ch, CURLOPT_TIMEOUT, 500); 
    

    Where 500 is the maximum number of seconds to allow cURL functions to execute.

    Here is an example of initializing a new cURL session and fetching a web page:

    <?php
    // create a new cURL resource
    $ch = curl_init();
    
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_TIMEOUT, 500); 
    
    // grab URL and pass it to the browser
    curl_exec($ch);
    
    // close cURL resource, and free up system resources
    curl_close($ch);
    ?>
    
    Login or Signup to reply.
  2. Maybe you should enable stream_ socket_ server

    Login or Signup to reply.
  3. Use the below mention in your curl request

    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); 
    curl_setopt($ch, CURLOPT_TIMEOUT, 400); //timeout in seconds
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search