How to set a minimum timeout for curl(like libcurl 7.29) in PHP7

To guarantee the development environment can respond successfully, I would like to set a minimum timeout value for the curl response to return, like 300ms, even when the timeout is set to 50ms in the code to be deployed to production environment.

  1. Is there a way to make this work?
  2. Or are there any other alternatives to realize this? I just want the dev not to time-out due to the low performance of the test/dev machine.


CentOS Linux release 7.2.1511 (Core)
$ curl -V
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.44 zlib/1.2.7 libidn/1.28 libssh2/1.8.0

Read more here:

Content Attribution

This content was originally published by Dylan Su at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: