introduction screenshots faq forum blog modules components download
Please use the search function and/or read the FAQ first.
-->

Using cURL in CLI



Posted by: flo234
June 22, 2009 07:36PM
Hi,

I'm pretty new to scripting with CLI and I have a problem with cURL :)

When I use phpinfo() while in "normal mode" everything is OK:
curl
cURL support enabled
cURL Information libcurl/7.16.0 OpenSSL/0.9.8i zlib/1.2.3

And everything work (I can browse a remote file without any problem, and grab information from a xml file for exemple).

But while using cURL in my CLI script (which is a little "bot" for irc) I have this error "Fatal error: Call to undefined function curl_init()" so I think i missed something !

I searched on google and didn't find any informations that helps me, so I hope your knowledge will be helpfull :)
(for your information i'm using easyphp 3.0, and i already modified php.ini in order to have curl OK in normal mode at least)

Ps: Sorry for my English



Edited 1 time(s). Last edit at 06/22/2009 07:37PM by flo234.
Posted by: Amour
June 23, 2009 07:57AM
With CLI, you must specify where is php.ini : the "-c" (+ path) option is your friend ;)
Posted by: flo234
June 25, 2009 11:44AM
Oh, yes you were right, when using -m or --ini i saw that curl was not running while using cli (and that my custom php.ini file wasn't properly loaded)

Everything is ok with the good php.ini specified :) (or by puting the php.ini in /windows dir as it was the defaut location)

Thank you!