开发者

Have enabled php/curl, but am still getting error "Call to undefined function curl_init()"

开发者 https://www.devze.com 2023-03-08 12:19 出处:网络
Sorry, I realise this is an oft-asked question but I\'ve followed all of the standard advice to no avai开发者_如何学运维l.

Sorry, I realise this is an oft-asked question but I've followed all of the standard advice to no avai开发者_如何学运维l.

I'm trying to use a php library written by somebody else which provides wrapper functions for curl. I have uncommented extension=php_curl.dll in the php.ini file, saved it and restarted my server (Wampserver). I have also done a phpinfo() in the browser which says that curl is enabled, however I continue to get the error mentioned above.

Here is snippet of the code, with the offending line 249 -

function http($target, $ref, $method, $data_array, $incl_head)
{
# Initialize PHP/CURL handle
$ch = curl_init(); <----

# Prcess data, if presented
if(is_array($data_array))
    {
    # Convert data array into a query string (ie animal=dog&sport=baseball)
    foreach ($data_array as $key => $value)
    etc...

I have triple checked all of the above and even restarted my computer and checked again in desperation - the curl extension is definitely uncommented and phpinfo() definitely shows curl as being enabled.

Hope someone might have an idea what's up?

Thanks, Paul.


You need to enable php_curl.dll in two locations

  • Open C:wamp\bin\php\php5.2.6\php.ini
  • Find “;extension=php_curl.dll” and remove the semicolon to uncomment the line
  • Do the same for C:wamp\bin\apache\apache2.2.8\bin\php.ini


you need to uncomment PHP curl in the php.ini file and make sure the dll is available.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号