Current time: 05-09-2024, 09:57 AM Hello There, Guest! (LoginRegister)


Post Reply 
Problem with libcurl
Author Message
gnatbite Offline
Newbie
*

Posts: 8
Joined: Apr 2007
Reputation: 0
Post: #1
Problem with libcurl
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?
06-13-2007 02:17 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Problem with libcurl - gnatbite - 06-13-2007 02:17 AM
RE: Problem with libcurl - BeNe - 06-13-2007, 03:35 AM
RE: Problem with libcurl - ephigenie - 06-13-2007, 06:06 AM
RE: Problem with libcurl - gnatbite - 06-13-2007, 07:51 AM
RE: Problem with libcurl - katun - 01-09-2008, 07:54 AM
RE: Problem with libcurl - joximu - 01-09-2008, 08:32 AM
RE: Problem with libcurl - katun - 01-09-2008, 08:54 AM
RE: Problem with libcurl - joximu - 01-09-2008, 09:16 AM
RE: Problem with libcurl - BioALIEN - 01-09-2008, 02:26 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)