php 调用未定义的函数 curl_init()

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10226983/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 21:42:16  来源:igfitidea点击:

Call to undefined function curl_init()

phpfoursquare

提问by Adeel Kamal

Possible Duplicate:
curl_init() function not working

可能重复:
curl_init() 函数不起作用

I am using PHP for accessing the Foursquare API. I have set up everything for the authentication with Foursquare. But as soon as I click on the "Allow" button, my callback.php gives me the following error:

我正在使用 PHP 来访问 Foursquare API。我已经为 Foursquare 的身份验证设置了一切。但是一旦我点击“允许”按钮,我的 callback.php 就会出现以下错误:

Fatal error: Call to undefined function curl_init() in C:\wamp\www\EpiFoursquare.php on line 119

Call Stack

Time    Memory  Function                          Location
0.0007  372592  {main}( )                         ..\callback.php:0
0.0039  571896  EpiFoursquare->getAccessToken( )  ..\callback.php:17
0.0040  572928  EpiFoursquare->request( )         ..\EpiFoursquare.php:31

Where does this error come from? I cannot find the origin. Please help me out.

这个错误从何而来?我找不到原点。请帮帮我。

回答by zerkms

You need to initialize the cURL extension: http://php.net/manual/en/curl.installation.php

您需要初始化 cURL 扩展:http: //php.net/manual/en/curl.installation.php

回答by FlatLander

  1. remove ;from extension=php_curl.dllin php.ini;
  2. ensure that ssleay32.dlland libeay32.dllare in Windows/system32;
  3. copy php_curl.dllinto Windows\System32as well.
  1. 除去;extension=php_curl.dll处于php.ini;
  2. 确保ssleay32.dlllibeay32.dllWindows/system32
  3. 也复制php_curl.dll进去Windows\System32

This worked for me!

这对我有用!