I tried to install and use curl but it does not work, I do not know if I just don't understand how to use curl or if I did something wrong during installation...
I will describe my problem in details so that hopefully you will be able (and willing) to tell me what I am doing wrong quickly.
I installed openssl-0.9.5 and cURL-7.1.1 with ssl support into
/usr/local/curl_ssl, it seems that this works fine..
Then I compilled an apache-1.3.12 web-server + mod_ssl, works fine.
Then I compilled php-4.0.1pl2 with mysql support with these configure
parametrs:
./configure --with-mysql=/usr/local/mysql \
--with-apxs=/usr/local/apache_ssl/bin/apxs \
--with-curl=/usr/local/curl_ssl
I added the PHP module (mysql curl included) through apachi DSO support...
compiling ok,
installing,
start apache,
Now, I'm trying to use cURL by testing the command from zend manual:
echo curl_version();
$ch = curl_init ("http://www.php.net/");
$fp = fopen ("php_homepage.txt", "w");
curl_setopt ($ch, CURLOPT_INFILE, $fp);
... and so on..
I am 100% sure that I used good function - I tried command which you can find in documentation on cURL page:
$ch = curl_easy_init ("http://www.php.net/");
$fp = fopen ("php_homepage.txt", "w");
curl_easy_setopt ($ch, CURLOPT_INFILE, $fp);
curl_easy_setopt ($ch, CURLOPT_HEADER, 0);
....
on both of eg. there are same mistake:
Fatal error: Call to unsupported or undefined function.....in.. on line..
What I did wrong??
Desperate, I think that I have maybe not loaded the dynamic library,
so I filled-in an extension dir variable in php.ini file
(extension_dir = /usr/local/curl_ssl/lib/)
and into extensions i wrote this:
extension=libcurl.so
and I tried to start apache, there was this in my log:
PHP Warning: Invalid library (maybe not a PHP library) 'libcurl.so' in
Unknown on line 0
PHP Warning: Invalid library (maybe not a PHP library) 'libcurl.so' in
Unknown on line 0
...
Then I tried to use 'dl()' command in php script..
dl("libcurl.so");
and output is:
Warning: Invalid library (maybe not a PHP library) 'libcurl.so' in
/usr/local/apache/htdocs/curl.php3 on line 2
Fatal error: Call to undefined function: curl_version() in
/usr/local/apache/htdocs/curl.php3 on line 4
Do you have any idea how to compile it as 'PHP library' or how to load in PHP
I tried to find some stuff, some articles about it, but it all
ends with, use --with-curl[DIR] for compiling..
Do you have any idea what I did not do correctly? I am desperately waiting for any hint or detailed description of somebody who installed it successfully on his server(s). If you need to know more to diagnose the problem, just ask: chrala@adent.cz