0

I have set the following:

curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);

before calling curl_exec($ch)

However, every now and then, I get an error: GOT AN ERROR<br/>Operation timed out after 10002 milliseconds with 0 bytes received<br/>-------<br/>

Seems curl is not respecting the timeout settings. I tried setting the _MS versions also, but to no avail. Please help!

5
  • Maybe the server you connect to has a timeout? Commented Oct 7, 2013 at 16:33
  • @Niels: Interesting... any ideas how can I check? The results are unpredictable as of now. Commented Oct 7, 2013 at 16:35
  • @workwise have you got and htaccess file? update the timeout there. Commented Oct 7, 2013 at 16:36
  • @Tauseef Yes, actually I have access to both the calling server and the server I connect to. Can you tell me where exactly I need to put the timeout in which htaccess - I haven't done it before. Commented Oct 7, 2013 at 16:37
  • Also, I feel 1000 ms is bit too low for apache settings (I hear default is 300) Commented Oct 7, 2013 at 16:41

1 Answer 1

1

.htAccess are able to override a subset of the server's global configuration for the directory that they are in, and all sub-directories.

find the property max_execution_time in the .htaccess of your website. this time is in seconds as I remember.

EDIT: Also check the PHP.ini file

<IfModule mod_php5.c>
php_value post_max_size 5M
php_value upload_max_filesize 5M
php_value memory_limit 300M
php_value max_execution_time 259200
php_value max_input_time 259200
php_value session.gc_maxlifetime 1200
</IfModule>

Increase max execution time for php

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.