Call to undefined function curl_init() error with WAMP

南笙酒味 提交于 2019-12-02 08:56:46

问题


I know that it's a very often asked problem, but I've tried all that I found and it still doesn't work.

I use WAMP 2.2 on Windows 7 (64 bits), and PHP 5.4.3. When I call curl_init() in localhost, I've this error message :

Call to undefined function curl_init() 

What I've done :

  • Check php_curl in PHP extensions of WAMP
  • Restart WAMP many times
  • Remove ; before extension=php_curl.dll in my two php.ini files
  • Check extension_dir = "c:/wamp/bin/php/php5.4.3/ext/" in my two php.ini files
  • Restart WAMP many times
  • Change the DLL for this supposedly corrected DLL http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
  • Restart WAMP many times

And when I call php_info(), I cannot find curl...


回答1:


Go to this link download *php_curl-5.4.3-VC9-x64.zip* under "Fixed curl extensions:" and replace the php_curl.dll in ext folder. This worked for me.




回答2:


Do as 4life suggests, but make sure you get the dll called php_curl-5.4.3-VC9-x64.zip

do not try to use the one called php_curl-5.4.3-nts-VC9-x64.zip

WAMP requred Thread Safe dll's and the -nts- stands for Not-Thread_Safe




回答3:


My late reply may be useful to someone.

During my experience of this issue, I found that none of the suggestions here nor on other forums resolved it.

In my case I had installed the Wamp folder outside of the Program Files folder, however the php.ini file incorrectly referenced C:\Program Files\wamp in multiple places.

Therefore, amending the path in php.ini in several places resolved my issue.

To achieve this:

  • Load php.ini into your favourite text editor
  • Search for each instance of "Program Files"
  • Update the filepath for each one
  • Save the changes to make them permanent.



回答4:


for me, I have wampp installed, none of the former worked. Curl worked only when I clicked the wamp icon and enabled the curl module from there. So left click wamp, choose php extensions and choose curl from there. good luck



来源:https://stackoverflow.com/questions/16234239/call-to-undefined-function-curl-init-error-with-wamp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!