narek.gevorgyan
narek.gevorgyan

Reputation: 4185

Facebook needs the CURL PHP extension

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.

Upvotes: 23

Views: 41244

Answers (8)

Pramod Waikar
Pramod Waikar

Reputation: 95

I was having same issue with Ubuntu 16.04 LTS and PHP 5.6 (LEMP) configuration. This has been resolved by below commands.

$ 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)

Verify the curl.in file

$ sudo vi /etc/php/5.6/mods-available/curl.ini

It should be

*; configuration for php curl module

; priority=20

extension=curl.so*

Verify the Curl enabled in php

$ php -i | grep curl

output should be;

cURL support => enabled

cURL Information => 7.35.0

Age => 3

Features

AsynchDNS => Yes

CharConv => No

Debug => No

GSS-Negotiate => Yes

IDN => Yes

IPv6 => Yes

krb4 => No

Largefile => Yes

libz => Yes

NTLM => Yes

NTLMWB => Yes

SPNEGO => No

SSL => Yes

SSPI => No

TLS-SRP => Yes

Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smtp, smtps, telnet, tftp

Host => x86_64-pc-linux-gnu

SSL Version => OpenSSL/1.0.1f

ZLib Version => 1.2.8

Restart the php5.6-fpm

$ sudo service php5.6-fpm restart

Restart the Nginx

$ sudo service nginx restart

This will work :)

Upvotes: 2

Ashish Yadav
Ashish Yadav

Reputation: 557

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.

Upvotes: 18

Sagar Arora
Sagar Arora

Reputation: 1783

Open phpini file and uncomment the below curl extension. Then restart your wamp server.This work fine.

;extension=php_curl.dll

Upvotes: 0

Sheraz
Sheraz

Reputation: 71

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

Upvotes: 1

gravetii
gravetii

Reputation: 9624

Facebook API needs the curl PHP extension. All you need to do is to change the settings in the php.ini file.

Search the file for "extension=php_curl". Uncomment that line by removing the semi-colon infront of it. That should work!

Upvotes: 0

Yannick Richard
Yannick Richard

Reputation: 1249

only needs to uncomment extension=php_curl.dll from c:\xampp\php\php.ini

Upvotes: 3

mona rajput
mona rajput

Reputation: 61

Error:

Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension

Solution:

;extension=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.

2) Restart appache (XAMPP)

Upvotes: 5

uncreative
uncreative

Reputation: 1446

in a new php page type:

<?php
phpinfo();
?>

in there check to see which php.ini you need to edit.

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 support   enabled

if it is not enabled after editing the ini file and restarting the web server, things depend on how you installed php

this guide looks promising enough

Upvotes: 14

Related Questions