|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-11-11 18:01 UTC] kf at sumptuouscapital dot com
Description: ------------ 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 [0] http://curl.haxx.se/libcurl/c/curl_easy_setopt.html Test script: --------------- <?php // Minimum working example to produce the reported behavior $ch = curl_init("https://www.google.com:80/"); curl_setopt($ch, CURLOPT_RESOLVE, "google.com:80:173.194.32.5"); curl_exec($ch); ?> Expected result: ---------------- No warning Actual result: -------------- works, but with notice and warning output. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 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 keep them only in php next (5.5). Also curl_setopt with CURLOPT_RESOLVE will not take a string as 3rd parameter but an array of string (the original libcurl option take a curl_slist) curl_setopt($ch, CURLOPT_RESOLVE, array("google.com:80:173.194.32.5"));