2012-04-19 58 views
7

Possible Duplicate:
curl_init() function not working调用未定义功能curl_init()

我使用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 

这个错误来自哪里?我找不到原点。请帮助我。

+1

这个问题与foursquare完全没有关系。在php中打开'curl'模块。 “我只是不知道,它为什么起源。” ---为什么你不读错误信息呢? – zerkms 2012-04-19 11:31:32

+0

先生其实我得到这个错误,它说“致命的错误:调用未定义的函数curl_init()在C:\ wamp \ www \ EpiFoursquare.php在119行”和所有必要的文件被放置在文件夹中,像回调.php,index.php,EpiCurl.php – 2012-04-19 11:37:45

+4

'curl'是一个php扩展http://nz.php.net/manual/en/curl.installation.php – zerkms 2012-04-19 11:42:03

回答

12

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

+0

我通过在php.ini文件中启用php_curl.dll扩展来完成此操作(因为FlatLander也提到了这一点)。由于我使用WAMP服务器,因此我不需要做任何事情,因为ssleay32.dll,libeay32.dll和php_curl.dll文件已经位于我的C:\ wamp \目录中的正确位置。 – 2013-08-23 20:15:41

9
  1. extension=php_curl.dll删除;php.ini;
  2. 确保ssleay32.dlllibeay32.dllWindows/system32;
  3. php_curl.dll复制为Windows\System32

这对我有效!

+0

我试过这个,但它对我不起作用。我不确定在过去几年中是否有更新。我正在使用PHP 5.6.13。 与上面一样,我不得不从'php.ini'中的'extension = php_curl.dll'中删除';',我还不得不从'php.ini'的'extension_dir ='ext''中删除';'。 – zrbecker 2015-09-04 17:58:34