Re: curl_init() ??
| From: | David Robley | Date: | Thu, 12 Sep 2002 10:22:50 +0000 |
| Subject: | Re: curl_init() ?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116128@lists.php.net to get a copy of this message | ||
In article <42D868DE-C62E-11D6-8FE6-003065411570@bigtree.com.au>,
geofflists@bigtree.com.au says...
> Hi,
> I am using PHP v.4.1.2, CURL v7.7.2 with Apache server on MacOS X
> 10.1.5
> I have a PHP script containing the following:
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL,"http://omitted.com");
> curl_setopt($ch, CURLOPT_FAILONERROR, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, "salexml=$saleXML");
> $result=curl_exec ($ch);
> curl_close ($ch);
>
> When I run the script I receive the following error:
> Fatal error: Call to undefined function: curl_init()
>
> My reading of the PHP manual, Curl man pages, curl web site and PHP
> books and articles in the curl-php mailing list indicate that this
> should work.
>
> Can someone tell me how to get PHP to recognise the function
> "curl_init()" or tell me another method of getting a PHP script to
> simulate POST method as though the data was being sent from a form.
>
> TIA
It seems that the version of PHP you are using doesn't have curl support
compiled in/ doesn't have curl libs loaded through the ini file.
Run a script with <?php phpinfo() ?> to confirm you don't have curl
support; you may have to recompile or if you have the appropriate curl
exstension lib you can probably add/uncomment curl in the etensions
section of yor php.ini
> --
> Geoff Hill
> Information Technology Training & Solutions
> A.B.N. 28 712 665 728
So I don't need to withold tax on this reply:-)
Cheers
--
David Robley
Temporary Kiwi!
Quod subigo farinam