Jump to content


Photo

undefined function curl_init()


  • Please log in to reply
2 replies to this topic

#1 mcHenry

mcHenry
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 May 2006 - 12:31 AM

I am trying to use curl however am not having any success with a CLI script.
Fatal error: Call to undefined function: curl_init() in
C:\PHP4\cli\processweb.php on line 65


Windows XP
PHP 4.4.2

php info shows:
CURL support enabled
CURL Information libcurl/7.14.0 OpenSSL/0.9.8a zlib/1.2.3


Any help would be greatly appreciated.

Thanks in advance...

#2 test006

test006
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 21 May 2006 - 12:42 AM

[!--quoteo(post=375603:date=May 20 2006, 07:31 PM:name=mcHenry)--][div class=\'quotetop\']QUOTE(mcHenry @ May 20 2006, 07:31 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I am trying to use curl however am not having any success with a CLI script.
Fatal error: Call to undefined function: curl_init() in
C:\PHP4\cli\processweb.php on line 65
Windows XP
PHP 4.4.2

php info shows:
CURL support enabled
CURL Information libcurl/7.14.0 OpenSSL/0.9.8a zlib/1.2.3
Any help would be greatly appreciated.

Thanks in advance...
[/quote]
Hi,
I googled the following error "Fatal error: Call to undefined function: curl_init()" and got this web address back.
This might be of some use to you.
[a href=\"http://www.tonyspencer.com/mt/archives/2003/10/curl_with_php_a.htm\" target=\"_blank\"]http://www.tonyspencer.com/mt/archives/200..._with_php_a.htm[/a]
Let me know if this works.
If not let me know i have same setup as you and it is working for me.
Can you also post your code so i can have look.

Thanks


#3 mcHenry

mcHenry
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 May 2006 - 04:13 AM

[!--quoteo(post=375606:date=May 21 2006, 08:42 AM:name=test006)--][div class=\'quotetop\']QUOTE(test006 @ May 21 2006, 08:42 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hi,
I googled the following error "Fatal error: Call to undefined function: curl_init()" and got this web address back.
This might be of some use to you.
[a href=\"http://www.tonyspencer.com/mt/archives/2003/10/curl_with_php_a.htm\" target=\"_blank\"]http://www.tonyspencer.com/mt/archives/200..._with_php_a.htm[/a]
Let me know if this works.
If not let me know i have same setup as you and it is working for me.
Can you also post your code so i can have look.

Thanks
[/quote]

Thanks for the help...

I am working through the url you provided slowly...
I had guessed that as php_info() shows the curl module as loaded then this would have confirmed the config as being correct ?

I am executing a simple script using the command line:

C:\PHP4\cli>php testcurl.php

Fatal error: Call to undefined function: curl_init() in C:\PHP4\cli\testcurl.php on line 3

C:\PHP4\cli>


The code is simply:

<?php
$url="http://wwww.yahoo.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec ($ch);
curl_close ($ch);
?>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users