1

When i am tryin to manualy fetch a php page by passing URL, an exception is appearing which says

javax.servlet.ServletException: java.lang.RuntimeException: PHP Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.

but when I searched php curl in my insatllation directory, I found it there.

[ashish@hpproliant ~]$ which php
/usr/local/bin/php
[ashish@hpproliant ~]$ which curl
/usr/local/bin/curl

I have modified php.ini file where a line related to curl was commented..What do i need do do now?? Thanks

2 Answers2

0

maybe

sudo apt-get install php5-curl
user2231809
  • 43
  • 1
  • 5
0

Just follow the below steps, and check have you done exactly same as below:-

sudo apt-get install php5-curl

Make sure curl is enabled in the php.ini file (for me it's in /etc/php5/apache2/php.ini), if you can't find this line, it might be in /etc/php5/conf.d/curl.ini. Make sure the line :

extension=curl.so

is not commented out then restart apache, so type this into putty:

sudo /etc/init.d/apache2 restart

Debug:- Check whether curl is enable in PHP or not:-

Method 1:

function curlEnabled() {
    if (ini_get('safe_mode') == 1)
        return 0;

    return in_array('curl', get_loaded_extensions());
}

Method 2:

function_exists('curl_init');

and please print the php_info(); of your server and post it here.

Please Refer to the below links Too:- Detect if cURL works? PHP CURL Enable Linux

Community
  • 1
  • 1
Nishant
  • 3,614
  • 1
  • 20
  • 26
  • Hi Nishant..thanks for the help but the issue is 1) On My Linux cat /proc/version Linux version 2.6.18-8.el5 (brewbuilder@ls20-bc2-14.build.redhat.com) (gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)) #1 SMP Fri Jan 26 14:15:21 EST 2007 sudo apt-get install php5-curl is not working..Says sudo: apt-get: command not found – user1912027 Apr 01 '13 at 12:07
  • also i have made extension=curl.so enabled in my php.ini file located at /usr/local/lib .. also doin which curl gives following path /usr/local/bin/curl which suggests presence of curl... – user1912027 Apr 01 '13 at 12:19
  • http://122.166.59.161:7655/JavaBridgeTemplate621/test.php contains phpinfo of server – user1912027 Apr 01 '13 at 12:21