Hi all,
I installed drupal for facebook and when I click on my administer page instead of showing the page it displays the following message:
"Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in C:\wamp\www\movieland\sites\all\libraries\facebook-php-sdk\src\facebook.php:4 Stack trace: #0 C:\wamp\www\movieland\sites\all\modules\fb\fb.install(53): include() #1 [internal function]: fb_requirements('runtime') #2 C:\wamp\www\movieland\includes\module.inc(483): call_user_func_array('fb_requirements', Array) #3 C:\wamp\www\movieland\modules\system\system.admin.inc(1703): module_invoke_all('requirements', 'runtime') #4 C:\wamp\www\movieland\modules\system\system.admin.inc(21): system_status(true) #5 [internal function]: system_main_admin_page() #6 C:\wamp\www\movieland\includes\menu.inc(348): call_user_func_array('system_main_adm...', Array) #7 C:\wamp\www\movieland\index.php(18): menu_execute_active_handler() #8 {main} thrown in C:\wamp\www\movieland\sites\all\libraries\facebook-php-sdk\src\facebook.php on line 4"
So far this is the only problem I noticed. All other admin sections seems operational.
I use only fb.module (like button on my content nodes)and followed the installation instructions (README file - 1.Download from http://github.com/facebook/php-sdk. Extract the files, and place them in sites/all/libraries/facebook-php-sdk, 2.Your theme needs the following attribute at the end of the tag: xmlns:fb="http://www.facebook.com/2008/fbml")
So my html now looks like this :
print $language->language " lang=" print $language->language
" dir=" print $language->dir
">
print $language->language " lang=" print $language->language
" dir=" print $language->dir
" xmlns:fb="http://www.facebook.com/2008/fbml">
Like button displays normally on my nodes and seems operational except on frontpage where i display many nodes (teaser views of 1 content type) using ajax. When i click on like button of a node teaser view it "likes" all my nodes...
Also I see no new post on my facebook page unless i comment when I "like".
Should I post the last 2 as separate issues?(sorry I am new in posting issues)
Any suggestions?
Thanks in advance
Comments
Comment #1
funkycamel CreditAttribution: funkycamel commentedComment #2
funkycamel CreditAttribution: funkycamel commentedalso status reports shows the same message:
"Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in C:\wamp\www\movieland\sites\all\libraries\facebook-php-sdk\src\facebook.php:4 Stack trace: #0 C:\wamp\www\movieland\sites\all\modules\fb\fb.install(53): include() #1 [internal function]: fb_requirements('runtime') #2 C:\wamp\www\movieland\includes\module.inc(483): call_user_func_array('fb_requirements', Array) #3 C:\wamp\www\movieland\modules\system\system.admin.inc(1703): module_invoke_all('requirements', 'runtime') #4 C:\wamp\www\movieland\modules\system\system.admin.inc(21): system_status(true) #5 [internal function]: system_main_admin_page() #6 C:\wamp\www\movieland\includes\menu.inc(348): call_user_func_array('system_main_adm...', Array) #7 C:\wamp\www\movieland\index.php(18): menu_execute_active_handler() #8 {main} thrown in C:\wamp\www\movieland\sites\all\libraries\facebook-php-sdk\src\facebook.php on line 4"
Comment #3
funkycamel CreditAttribution: funkycamel commentedThe same when i try to run cron
Comment #4
funkycamel CreditAttribution: funkycamel commentedAfter uninstalling the module and deleting it, it seems that everything is back to normal.
Please advice or suggest another module.
The only thing I want to do is to add a "share and/or like" button on my content type nodes
Comment #5
Dave Cohen CreditAttribution: Dave Cohen commentedhttp://drupal.org/node/928034
I don't see how the error message could be any clearer.
Comment #6
funkycamel CreditAttribution: funkycamel commentedyes you have a point.
thanks
Comment #8
NancyDruYou can re-close after answering. I had this module installed for several days and until just now, when I enabled the jQuery Update and Superfish modules, it was fine without the extension. What would those modules have done to mess up FB?
Comment #9
Dave Cohen CreditAttribution: Dave Cohen commentedI have no idea, but I don't see how it was actually working correctly without CURL.
Comment #10
therobyouknow CreditAttribution: therobyouknow commentedI wish the solution was as clear - I'll do my bit to contribute to making the solution to the error message as clear as that - it isn't at the moment.
I'm not directing my comments at anyone and I say this because there does not seem to be a definitive approach to installing cURL support for PHP:
I'm seeing this problem in Drupal 7 but I am aware that the original poster was using Drupal 6.
Here's what I tried:
Installed PHP5-Curl:
restarted the webserver (I'm guessing this might be needed presumably to see/'pick-up' the changes:
service nginx restart
Enabled the modules I need:
root@li473-171:# drush en fb, fb_app, fb_connect
Cleared all caches:
Visited the
admin/config
page and still got the errorComment #11
Dave Cohen CreditAttribution: Dave Cohen commentedI don't know about your variant of linux but on archlinux I have to uncomment the curl line in php.ini.
Trying including the name of your linux distribution (which you did not mention here) in your google search.
Comment #12
Homotechsual CreditAttribution: Homotechsual commentedLooks like you're running ubuntu:
For pre 12.04:
sudo apt-get install php5-curl
sudo service apache2 restart
For 12.04 or later:
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
sudo service apache2 restart
You should double check your PHP.ini file to ensure that the curl extension is indeed enabled before restarting apache but curl will NOT be working until you restart Apache.
Comment #13
therobyouknow CreditAttribution: therobyouknow commentedStill no luck afraid to say but thank you for your input so far, MJCO. I have captured my attempts at your instructions below:
Yes, indeed I am using Ubuntu (Dave Cohen asked this as well - thanks for asking Dave, good question)
I did the following to find out which version I am on:
So on that basic I ran your commands for 12.04 or later:
Then I looked to edit php.ini to reference the curl.so shared object, on the basis that the plethora of curl setup documentation out there is for WAMP and there they mention setting up reference to curl.dll in php.ini So given that I am using Linux I would have thought that it would be necessary to do similar here.
So I first find where.php is:
and open it for edit:
In the file, in the existing section:
Interestingly, if I run
php --ini
I now see:
PHP Warning: Module 'curl' already loaded in Unknown on line 0
In the output:
Anyway, I'll 'park' that thought for the time being and proceed...
I then use drush to clear all the caches and run cron
(not sure if these would help, actually, thoughts welcome)
Then re-enable all the modules
Still get same error when I visited the
admin/config
page:Exception: Facebook needs the CURL PHP extension. in require_once() (line 19 of /var/www/marketplace/sites/all/libraries/facebook-php-sdk/src/base_facebook.php).
The website encountered an unexpected error. Please try again later.
Comment #14
Dave Cohen CreditAttribution: Dave Cohen commentedRestarted apache?
Comment #15
therobyouknow CreditAttribution: therobyouknow commentedYes, I missed this out of the instructions, sorry. I'm using nginx but yes, restarted.
Comment #16
therobyouknow CreditAttribution: therobyouknow commentedThis problem mysteriously seems to have gone away; a colleague (with a fresh pair of eyes) worked through the steps and it was fine - can view the config page, not the fatal error messages seen.
Thanks for all your inputs.
Comment #17
Dave Cohen CreditAttribution: Dave Cohen commentedIf you figure out exactly what fixed it, let us know.
Comment #18
therobyouknow CreditAttribution: therobyouknow commentedDave, thanks for following up I would love to get to the root cause, I have no answer for this at the moment as it's not known. But at least, I hope my steps help folks set things up.
Comment #20
winternett CreditAttribution: winternett commented> Dave's comment fixed the issue for me - "You should double check your PHP.ini file to ensure that the curl extension is indeed enabled before restarting apache but curl will NOT be working until you restart Apache. "
I opened my php.ini, searched (CTRL+F) for "curl" un-commented the line and re-started Apache. Did not need to uninstall the Facebook modules.