|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63488 CURLOPT_RESOLVE not defined
Submitted: 2012-11-11 18:01 UTC Modified: 2012-11-15 05:34 UTC
From: kf at sumptuouscapital dot com Assigned: pierrick (profile)
Status: Wont fix Package: HTTP related
PHP Version: 5.4.8 OS: GNU/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: kf at sumptuouscapital dot com
New email:
PHP Version: OS:


 [2012-11-11 18:01 UTC] kf at sumptuouscapital dot com
Since curl 7.21.3 curl_easy_setopt has an option CURLOPT_RESOLVE [0]. Using this option from within PHP results in the following NOTICE and WARNING. Usage of this functionality is necessary for proper Sever Name Indication for verifying CA Certs in certain scenarios. The actual functionality presented by this option seems to work despite the notice and warning. 

The notice is: 

PHP Notice:  Use of undefined constant CURLOPT_RESOLVE - assumed 'CURLOPT_RESOLVE' in /var/www/localhost/htdocs/status-srv/sks_get_peer_data.php on line 351

This Notice can be removed by explicitly setting a string rather than using it as a constant, however, the following Warning is still presented in both scenarios: 

Warning: curl_setopt() expects parameter 2 to be long, string given in /var/www/localhost/htdocs/status-srv/sks_get_peer_data.php on line 351


Test script:
// Minimum working example to produce the reported behavior
$ch = curl_init("");
curl_setopt($ch, CURLOPT_RESOLVE, "");

Expected result:
No warning

Actual result:
works, but with notice and warning output. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-11 18:27 UTC] kf at sumptuouscapital dot com
Please disregard the part about the functionality working as expected, it does not use the provided information, just worked out in earlier testing due to circumstance. Due to this I'm flagging it as a bug rather than a RFE
 [2012-11-11 18:27 UTC] kf at sumptuouscapital dot com
-Type: Feature/Change Request +Type: Bug
 [2012-11-11 18:43 UTC]
Such feature has been implemented in master branch only.
 [2012-11-11 18:43 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pierrick
 [2012-11-15 05:34 UTC]
-Status: Assigned +Status: Wont fix
 [2012-11-15 05:34 UTC]
As mentioned by felipe, it was implemented in the master branch. It was also 
decided on internal to not merge all the new ext/curl features in 5.3/5.4 but 
them only in php next (5.5). 

Also curl_setopt with CURLOPT_RESOLVE will not take a string as 3rd parameter 
an array of string (the original libcurl option take a curl_slist)

curl_setopt($ch, CURLOPT_RESOLVE, array(""));
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Feb 07 18:05:49 2023 UTC