Current location: Hot Scripts Forums » Programming Languages » PHP » Fatal error: Call to undefined function: curl_init()


Fatal error: Call to undefined function: curl_init()

Reply
  #1 (permalink)  
Old 02-11-06, 01:30 PM
hossamhamdi1986 hossamhamdi1986 is offline
Newbie Coder
 
Join Date: Aug 2005
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Fatal error: Call to undefined function: curl_init()

when i try to open the file

Fatal error: Call to undefined function: curl_init()

PHP Code:

    $ch curl_init();

    
curl_setopt($chCURLOPT_URL,"http://www.cairoline.com/test.php");
    
curl_setopt($chCURLOPT_REFERER$_SERVER['HTTP_HOST'] . $url);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    
curl_setopt($chCURLOPT_POST1); 
what's wrong

my php ver 4.4.1
Reply With Quote
  #2 (permalink)  
Old 02-11-06, 03:12 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Most likely curl support is not enabled.

You can check by creating a .php file with a phpinfo(); command in it. Browse to this and search/look for curl on the resulting page. If support is enabled, there will be a listing for it.

PHP Code:

<?php

phpinfo
();
?>
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #3 (permalink)  
Old 02-11-06, 04:22 PM
hossamhamdi1986 hossamhamdi1986 is offline
Newbie Coder
 
Join Date: Aug 2005
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
i can't find it

i've upload php file but when i search for curl i didn't find it
Reply With Quote
  #4 (permalink)  
Old 02-11-06, 04:40 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
If this is with a hosting company, you will need to have them install/enable it.

If this is a Windows based system, CURL can be enabled by uncommenting the curl extension line in the php.ini file - extension=php_curl.dll and restarting the web server.

If this is Unix/Linux, PHP must be compiled with CURL support and the libcurl library must be installed.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #5 (permalink)  
Old 01-05-09, 10:06 AM
abhicute abhicute is offline
New Member
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
try this

There are 3 different versions of php.
php as a apache module
php-cli
php-cgi.

The one you want is php-cli (command line interface), which probably isn't compiled with curl support in your case.
A way around is to use wget.
* * * * * wget -bq -o /dev/null http://www.yoursite.com/script.php >/dev/null 2>&1
Reply With Quote
  #6 (permalink)  
Old 01-24-09, 05:45 PM
oilcanfighter oilcanfighter is offline
New Member
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
I just had this problem on Ubuntu.

I installed the php5-curl package ("sudo apt-get install php-curl")
Then I restarted the apache web server ("sudo /etc/init.d/apache2 restart")

Good luck!
Reply With Quote
The Following User Says Thank You to oilcanfighter For This Useful Post:
buddhaflow (03-11-12)
  #7 (permalink)  
Old 04-18-09, 12:01 AM
TWARITA TWARITA is offline
Newbie Coder
 
Join Date: Apr 2009
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
getting Fatal error: Call to undefined function curl_init() in D:\xampp\htdocs\crawling.php on line 5

when i try to run the file....

thanks in advance
Reply With Quote
  #8 (permalink)  
Old 04-18-09, 03:33 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
- Open D:\xampp\apache\bin\php.ini
- Remove the semi-colon in front of this line: extension=php_curl.dll
- Restart Apache
Reply With Quote
  #9 (permalink)  
Old 04-18-09, 03:37 AM
TWARITA TWARITA is offline
Newbie Coder
 
Join Date: Apr 2009
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
thanks a lottt
Reply With Quote
  #10 (permalink)  
Old 05-21-09, 10:08 AM
digitalpbk digitalpbk is offline
New Member
 
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
More

This problem arises because of not including the lib_curl.dll to PHP. To solve this uncomment the line as shown below

;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll



Now restart apache server.
If you get an error "Unable to Load X:/path/php/ext/php_curl.dll", copy

* SSLEAY32.PHP
* libEAY32.dll

(OpenSSL) Libraries to the System32 folder.

Now restart apache server and you are good to go.

Last edited by Nico; 05-21-09 at 12:07 PM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 5 (0 members and 5 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fatal error: Call to undefined function: isloggedin() in xxvatarxx PHP 2 01-14-06 05:33 PM
ASP upload prob minority ASP 1 06-27-05 08:35 AM
Fatal error: Call to undefined function mysql_connect() in C:\Core Media\test_mysql.p phpbeginner PHP 1 07-24-04 12:40 PM
PHP Error Fairnie PHP 8 06-26-04 07:15 AM
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 09:50 AM


All times are GMT -5. The time now is 06:33 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.