Hi guys, I installed libcurl for a Online shop running on my server. This online shop needs libcurl to commuicate with a special creditcard company. So I installed libcurl but I have got a problem. The curl library is not working properly.
That's what I have done.
- Created a normal domain for the shop
- Changed to PHP5 (like described here)
- Installed Zendoptimizer (necessary for the online shop)
- Installed libcurl
- Added Zend and Curl to the corresponding php.ini
Code:
zend_extension=/usr/lib/php5/ZendOptimizer.so
zend_optimizer.optimization_level=15
extension=curl.so
infophp() says that zend and curl are installed:
Code:
Zend OptimizerOptimization Pass 1 enabled
...
Code:
cURL support enabled
cURL Information libcurl/7.15.5 OpenSSL/0.9.8c zlib/1.2.3 libidn/0.6.5
But if I try to use the curl library, it doesnt work like it should.
Example from
here
Code:
<?php
$ch = curl_init("http://www.example.com/");
$fp = fopen("example_homepage.txt", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>
If I do understand correct, the code above should write the index-page from example.com to the specified textfile: example_homepage.txt
But it doesnt do that. Instead of that, i get the following content in the textfile.
Code:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://myispcp-domain.com/">here</a>.</p>
<hr>
<address>Apache/2.2.3 (Debian) mod_fastcgi/2.4.2 mod_ssl/2.2.3 OpenSSL/0.9.8c Server at www.mydomain.com Port 80</address>
</body></html>
That seems to be kind of webpage generated by ispcp or something, because there is a link to my default ispcp-login. By the way, the domain myispcp-domain.com is also my hostname. Any ideas?
Does someone have any idea?