【问题标题】:Call to undefined function curl_init() [duplicate]调用未定义的函数 curl_init() [重复]
【发布时间】:2012-04-19 11:23:49
【问题描述】:

可能重复:
curl_init() function not working

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

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

【问题讨论】:

  • 这个问题与foursquare完全无关。在 php 中打开 curl 模块。 “我只是不知道,为什么它是起源的。” --- 那你为什么不看错误信息呢?!
  • 先生,实际上我收到了这个错误,它说“致命错误:在第 119 行的 C:\wamp\www\EpiFoursquare.php 中调用未定义的函数 curl_init()”,所有必要的文件都是放在文件夹中,如callback.php、index.php、EpiCurl.php
  • 非常感谢。它有效:)
  • 我已连接到 4square 网站,在回调时,它必须 f=给我访问令牌。但是当我回显 $token["access_token"] 时,它是空的。

标签: php foursquare


【解决方案1】:

【讨论】:

  • 我通过在 php.ini 文件中启用 php_curl.dll 扩展来做到这一点(正如 FlatLander 也提到的)。由于我使用 WAMP 服务器,我不需要做任何其他事情,因为 ssleay32.dll、libeay32.dll 和 php_curl.dll 文件已经在我的 C:\wamp\ 目录中的正确位置。
【解决方案2】:
  1. 从extension=php_curl.dll 中的php.ini 中删除;;
  2. 确保ssleay32.dll 和libeay32.dll 在Windows/system32 中;
  3. 也将php_curl.dll 复制到Windows\System32。

这对我有用!

【讨论】:

  • 我试过这个,但它对我不起作用。我不确定最近几年是否有更新。我正在使用 PHP 5.6.13。如上所述,我必须从php.ini 中的extension=php_curl.dll 中删除;,我还必须在php.ini 中从extension_dir = "ext" 中删除;。
猜你喜欢
  • 2013-05-12
  • 2011-09-16
  • 2015-07-02
  • 2015-05-31
  • 1970-01-01
  • 2012-08-18
  • 1970-01-01
相关资源
最近更新 更多