|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31612 No error message returned from curl_error() when connection fails by IP.
Submitted: 2005-01-19 17:02 UTC Modified: 2005-02-07 22:37 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: brian dot sanders at cometsystems dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5.0.2 OS: Fedora Core 3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: brian dot sanders at cometsystems dot com
New email:
PHP Version: OS:


 [2005-01-19 17:02 UTC] brian dot sanders at cometsystems dot com
When requesting a file from a bad IP (in this case, with no Web server running) cURL fails to retreive a page (as expected.)  curl_errno() returns an error code of 7, but curl_error returns NULL.

Reproduce code:

$ch = curl_init();
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($ch, CURLOPT_URL, '');
$result = curl_exec($ch);

print('Error code: '.curl_errno($ch)."\n");
print('Error message: '.curl_error($ch)."\n");


Expected result:
Failed to connect (or some such error)

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-31 14:02 UTC] daniel at haxx dot se
This may in fact depend on what error message libcurl reports back, and then this may change depending on what libcurl version you use. There are/were in fact times when libcurl doesn't return an error message (which is considered a bug).

Unless the PHP/curl binding is modified to use the curl_easy_strerror() function.
 [2005-02-07 22:37 UTC]
Likely a bug with old libcurl version.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 23 21:03:34 2021 UTC