调用未定义的函数curl_init().?

Pra*_*rma 335 php curl

当我要实现Authorize.net支付网关时.但是,我收到了这个错误:

调用未定义的函数curl_init()

请让我知道它有什么问题.

rah*_*ari 706

如果你在Windows上:

转到php.ini文件并;从以下行的开头删除标记:

;extension=php_curl.dll
Run Code Online (Sandbox Code Playgroud)

保存文件后,必须重新启动HTTP服务器软件(例如Apache)才能生效.


对于Ubuntu 13.0及更高版本,只需使用解压缩的软件包即可.在终端类型中安装以下内容并且不要忘记重新启动服务器.

sudo apt-get install php-curl
Run Code Online (Sandbox Code Playgroud)

或者如果你使用旧的PHP5

sudo apt-get install php5-curl
Run Code Online (Sandbox Code Playgroud)

要么

sudo apt-get install php5.6-curl
Run Code Online (Sandbox Code Playgroud)

  • 确保在进行此更改后重新启动Apache服务器. (70认同)
  • 如果这不起作用,请查看[此问题](http://stackoverflow.com/questions/12380670/call-to-undefined-function-curl-init-error-in-wamp-2-2).它提供了一个链接,用于下载PHP 5.3.13(或5.4.3)的"固定"`php_curl.dll`.我把所有配置都正确但是'curl`刚刚没有加载(没有出现在`phpinfo()`).这解决了我的问题. (19认同)
  • 在linux上,你取消注释或在你的php.ini中添加`extension = php_curl.so`并重新启动apache (7认同)
  • sudo apt-get install php-curl然后sudo service apache2 reload完成! (3认同)
  • 如果您从 cmd 使用,还有另一个 php.ini 文件,更多信息如下:http://stackoverflow.com/questions/2750580/how-to-find-the-php-ini-file-used-by-the -命令行 (2认同)
  • 在 ubuntu 中通过 `php -v` 检查 php 版本。我的 php 版本是“7.3”。根据您的版本“apt-get install php7.3-curl”安装 php curl。重新启动你的 apache2 `service apache2 restart` (2认同)

Ste*_*rig 14

ext/curlPHP安装中未安装或启用CURL扩展.有关如何在系统上安装或启用CURL的信息,请查阅手册.

  • (Win32)我还必须在我的PATH中添加`c:\ php`.我从上面的链接中学到了阅读手册.手册说`libeay32.dll`和`ssleay32.dll`必须都在PATH上才能运行模块. (2认同)

Dar*_*ric 9

你必须用PHP启用curl.

是相同的说明