Facebook 需要 CURL PHP 扩展
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8465586/
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
Facebook needs the CURL PHP extension
提问by narek.gevorgyan
I'm trying to run my first facebook php application on my apache server.
It gives error Facebook needs the CURL PHP extension.
. I have added line extension=php_curl.dll
in php.ini and it runs normally in phpStorm ide.
But it still gives error in web browser when I put php files into apache directory and run server manually.
我正在尝试在我的 apache 服务器上运行我的第一个 facebook php 应用程序。它给出了错误Facebook needs the CURL PHP extension.
。我extension=php_curl.dll
在 php.ini 中添加了一行,它在 phpStorm ide 中正常运行。但是当我将php文件放入apache目录并手动运行服务器时,它仍然在Web浏览器中出错。
采纳答案by uncreative
in a new php page type:
在新的 php 页面类型中:
<?php
phpinfo();
?>
in there check to see which php.ini you need to edit.
在那里检查以查看您需要编辑哪个 php.ini。
Loaded Configuration File: ________ path to ini file you must edit _______
Also, use this page to see if the server thinks curl is enabled. do you see this line:
此外,使用此页面查看服务器是否认为启用了 curl。你看到这条线了吗:
cURL support enabled
if it is not enabled after editing the ini file and restarting the web server, things depend on how you installed php
如果在编辑 ini 文件并重新启动 Web 服务器后未启用,则取决于您安装 php 的方式
this guidelooks promising enough
本指南看起来很有希望
回答by Ashish Yadav
I was also getting the error. I tried this command.
我也收到错误。我试过这个命令。
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
and my problem was resolved.
我的问题解决了。
回答by mona rajput
Error:
错误:
Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension
未捕获的异常“异常”带有消息“Facebook 需要 CURL PHP 扩展”
Solution:
解决方案:
;extension=php_curl.dll
;扩展= php_curl.dll
1) Remove ;
(comment from begining) in php.ini file and save. If this line is not in file than add this file.
1);
在 php.ini 文件中删除(从头开始注释)并保存。如果此行不在文件中,则添加此文件。
2) Restart appache (XAMPP)
2) 重启 appache (XAMPP)
回答by Yannick Richard
only needs to uncomment extension=php_curl.dll from c:\xampp\php\php.ini
只需要从 c:\xampp\php\php.ini 中取消注释 extension=php_curl.dll
回答by Pramod Waikar
I was having same issue with Ubuntu 16.04 LTS and PHP 5.6 (LEMP) configuration. This has been resolved by below commands.
我在 Ubuntu 16.04 LTS 和 PHP 5.6 (LEMP) 配置上遇到了同样的问题。这已通过以下命令解决。
$ sudo apt-get install curl libcurl3 libcurl3-dev php5.6-curl
$ sudo apt-get install curl libcurl3 libcurl3-dev php5.6-curl
verify the Curl.so file in extension directory $ php -i | grep extension_dir(This will give you path for PHP extension dir)
验证扩展目录中的 Curl.so 文件 $ php -i | grep extension_dir(这将为您提供 PHP 扩展目录的路径)
Verify the curl.in file
验证 curl.in 文件
$ sudo vi /etc/php/5.6/mods-available/curl.ini
$ sudo vi /etc/php/5.6/mods-available/curl.ini
It should be
它应该是
*; configuration for php curl module
*; php curl 模块的配置
; priority=20
; 优先级=20
extension=curl.so*
扩展=curl.so*
Verify the Curl enabled in php
验证在 php 中启用的 Curl
$ php -i | grep curl
$ php -i | 卷曲
output should be;
输出应该是;
cURL support => enabled
cURL 支持 => 启用
cURL Information => 7.35.0
卷曲信息 => 7.35.0
Age => 3
年龄 => 3
Features
特征
AsynchDNS => Yes
异步DNS => 是
CharConv => No
CharConv => 否
Debug => No
调试 => 否
GSS-Negotiate => Yes
GSS-协商 => 是
IDN => Yes
IDN => 是
IPv6 => Yes
IPv6 => 是
krb4 => No
krb4 => 没有
Largefile => Yes
大文件 => 是
libz => Yes
libz => 是的
NTLM => Yes
NTLM => 是
NTLMWB => Yes
NTLMWB => 是
SPNEGO => No
SPNEGO => 否
SSL => Yes
SSL => 是
SSPI => No
SSPI => 否
TLS-SRP => Yes
TLS-SRP => 是
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smtp, smtps, telnet, tftp
协议 => dict、文件、ftp、ftps、gopher、http、https、imap、imaps、ldap、ldaps、pop3、pop3s、rtmp、rtsp、smtp、smtps、telnet、tftp
Host => x86_64-pc-linux-gnu
主机 => x86_64-pc-linux-gnu
SSL Version => OpenSSL/1.0.1f
SSL 版本 => OpenSSL/1.0.1f
ZLib Version => 1.2.8
ZLib 版本 => 1.2.8
Restart the php5.6-fpm
重启php5.6-fpm
$ sudo service php5.6-fpm restart
$ sudo 服务 php5.6-fpm 重启
Restart the Nginx
重启 Nginx
$ sudo service nginx restart
$ sudo 服务 nginx 重启
This will work :)
这将工作:)
回答by Sheraz
i am using wamp on windows 7 64-bit. i have downloaded fixed curl extension version php_curl-5.3.13-VC9-x64.zip from url http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/and the issue is resolved. please keep php version in mind while download extension. I have downloaded this version as i am using php version 5.3.13
我在 Windows 7 64 位上使用 wamp。我已经从 url http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-下载了固定的 curl 扩展版本 php_curl-5.3.13-VC9-x64.zip 64-bit-for-windows/并且问题已解决。下载扩展时请记住 php 版本。我已经下载了这个版本,因为我使用的是 php 版本 5.3.13
回答by Sagar Arora
Open phpini file and uncomment the below curl extension. Then restart your wamp server.This work fine.
打开 phpini 文件并取消注释以下 curl 扩展名。然后重启你的 wamp server.This 工作正常。
;extension=php_curl.dll
回答by gravetii
Facebook API needs the curl PHP extension. All you need to do is to change the settings in the php.ini file.
Facebook API 需要 curl PHP 扩展。您需要做的就是更改 php.ini 文件中的设置。
Search the file for "extension=php_curl". Uncomment that line by removing the semi-colon infront of it. That should work!
在文件中搜索“extension=php_curl”。通过删除它前面的分号来取消注释该行。那应该工作!