|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79033 Curl timeout error with specific url and post
Submitted: 2019-12-26 01:07 UTC Modified: 2019-12-28 18:05 UTC
Avg. Score:2.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dav dot tur19 at gmail dot com Assigned: cmb (profile)
Status: Closed Package: cURL related
PHP Version: 7.4.1 OS: linux/windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
43 - 39 = ?
Subscribe to this entry?

 [2019-12-26 01:07 UTC] dav dot tur19 at gmail dot com
If an empty array is set to CURLOPT_POSTFIELDS, the request will timeout, this does not happen on php7.3 or with CURLOPT_POSTFIELDS with other values.
The problem occurs on both windows and linux.

Test script:
$token = '12341234:WASDWASD';
$method = 'getMe';
$args = [];

$curlRequestSession = curl_init();
curl_setopt_array($curlRequestSession, [
	CURLOPT_POST => true,
	CURLOPT_URL => '' . $token . '/' . $method,

$response = curl_exec($curlRequestSession);
if($response === false) {
	echo curl_error($curlRequestSession) . PHP_EOL . var_export(curl_getinfo($curlRequestSession), true) . PHP_EOL;
} else {
	echo 'Success: ' . $response . PHP_EOL;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-27 21:58 UTC]
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2019-12-27 21:58 UTC]
This regression has been introduced with commit a83b68b[1].

[1] <;a=commit;h=a83b68ba56714bfa06737a61af795460caa4a105>
 [2019-12-28 09:50 UTC]
Automatic comment on behalf of
Log: Fix #79033: Curl timeout error with specific url and post
 [2019-12-28 09:50 UTC]
-Status: Verified +Status: Closed
 [2019-12-28 14:53 UTC] dav dot tur19 at gmail dot com
have you checked the test file? the problem seemed to occur only on that specific url (, I couldn't even reproduce it on my webserver by setting 401 as http code and some other header.
 [2019-12-28 15:17 UTC]
Yes, I've also checked with the given test script, and that
returned "success" with the fix.  You can verify with
 [2019-12-28 16:17 UTC] dav dot tur19 at gmail dot com
I mean that the bug does not occur unless under certain conditions, for example with a normal page it did not occur
 [2019-12-28 18:05 UTC]
With PHP 7.4.1, the request that is sent is

POST /bot12341234:WASDWASD/getMe HTTP/1.1
Accept: */*
Content-Length: 46
Content-Type: multipart/form-data; boundary=------------------------3f43f848cba8eb3d


To my knowledge, this is a valid request, but apparently the empty
part may cause issues, and since former PHP versions sent

POST /bot12341234:WASDWASD/getMe HTTP/1.1
Accept: */*
Content-Length: 0

it seems to be prudent to generally switch back to that behavior.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 00:01:29 2024 UTC