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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6382539/
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-26 00:11:41  来源:igfitidea点击:

Call to undefined function curl_init().?

phpcurl

提问by Pramod Kumar Sharma

When i am going to implement Authorize.net payment gateway. However, I got this error:

当我要实施 Authorize.net 支付网关时。但是,我收到此错误:

Call to undefined function curl_init()

调用未定义的函数 curl_init()

Please let me know what is wrong in it.

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

回答by rahim asgari

If you're on Windows:

如果您使用的是 Windows:

Go to your php.ini file and remove the ;mark from the beginning of the following line:

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

;extension=php_curl.dll

After you have saved the file you mustrestart your HTTP server software (e.g. Apache) before this can take effect.

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



For Ubuntu 13.0 and above, simply use the debundled package. In a terminal type the following to install it and do not forgot to restart server.

对于 Ubuntu 13.0 及更高版本,只需使用 debundled 包。在终端中键入以下内容进行安装,不要忘记重新启动服务器。

sudo apt-get install php-curl

Or if you're using the old PHP5

或者如果您使用旧的 PHP5

sudo apt-get install php5-curl

or

或者

sudo apt-get install php5.6-curl

Then restart apache to activate the package with

然后重启apache激活包

sudo service apache2 restart

回答by Stefan Gehrig

The CURL extension ext/curlis not installed or enabled in your PHP installation. Check the manualfor information on how to install or enable CURL on your system.

ext/curl您的 PHP 安装中未安装或启用CURL 扩展。查看手册以获取有关如何在系统上安装或启用 CURL 的信息。

回答by Daric

You have to enable curl with php.

您必须使用 php 启用 curl。

Hereis the instructions for same

是相同的说明