简体   繁体   English

使用WAMP调用未定义的函数curl_init()错误

[英]Call to undefined function curl_init() error with WAMP

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. 我在Windows 7(64位)和PHP 5.4.3上使用WAMP 2.2。 When I call curl_init() in localhost, I've this error message : 当我在本地主机中调用curl_init()时,出现以下错误消息:

Call to undefined function curl_init() 

What I've done : 我所做的:

  • Check php_curl in PHP extensions of WAMP 检查WAMP的PHP扩展中的php_curl
  • Restart WAMP many times 多次重启WAMP
  • Remove ; 去掉 ; before extension=php_curl.dll in my two php.ini files 在我的两个php.ini文件中extension = php_curl.dll之前
  • Check extension_dir = "c:/wamp/bin/php/php5.4.3/ext/" in my two php.ini files 在我的两个php.ini文件中检查extension_dir =“ c:/wamp/bin/php/php5.4.3/ext/”
  • Restart WAMP many times 多次重启WAMP
  • 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/ 更改此据认为已纠正的DLL的DLL http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
  • Restart WAMP many times 多次重启WAMP

And when I call php_info(), I cannot find curl... 当我调用php_info()时,我找不到卷曲...

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. 转到此链接,在“固定的卷曲扩展名:”下下载* php_curl-5.4.3-VC9-x64.zip *,然后将ext_文件夹中的php_curl.dll替换。 This worked for me. 这对我有用。

Do as 4life suggests, but make sure you get the dll called php_curl-5.4.3-VC9-x64.zip 按照4life的建议进行操作,但请确保获得名为php_curl-5.4.3-VC9-x64.zip的dll。

do not try to use the one called php_curl-5.4.3-nts-VC9-x64.zip 不要尝试使用一个名为php_curl-5.4.3-nts-VC9-x64.zip的文件

WAMP requred Thread Safe dll's and the -nts- stands for Not-Thread_Safe WAMP需要线程安全dll,而-nts-代表Not-Thread_Safe

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. 就我而言,我已经在Program Files文件之外安装了Wamp 文件夹,但是php.ini文件在多个位置错误地引用了C:\\Program Files\\wamp

Therefore, amending the path in php.ini in several places resolved my issue. 因此,在几个地方修改php.ini中的路径可以解决我的问题。

To achieve this: 为达到这个:

  • Load php.ini into your favourite text editor php.ini加载到您喜欢的文本编辑器中
  • Search for each instance of "Program Files" 搜索“程序文件”的每个实例
  • Update the filepath for each one 更新每个文件路径
  • Save the changes to make them permanent. 保存更改以使它们永久。

for me, I have wampp installed, none of the former worked. 对我来说,我已经安装了wampp,但前者都没有起作用。 Curl worked only when I clicked the wamp icon and enabled the curl module from there. 仅当我单击wamp图标并从此处启用curl模块时,Curl才起作用。 So left click wamp, choose php extensions and choose curl from there. 因此,左键单击沼泽,选择php扩展名并从那里选择curl。 good luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM