cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

configuring curl with proxy servers

From: Pragya Ratna Bajracharya <pragyabchar_at_gmail.com>
Date: Mon, 30 Jun 2008 17:39:55 +0545

Hello all,

Based on this following example

<?

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://www.example.com');

curl_setopt($ch, CURLOPT_HEADER, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);

curl_setopt($ch, CURLOPT_PROXY, 'fakeproxy.com:1080');

curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'user:password');

$data = curl_exec();

curl_close($ch);

 ?>
I changed the value of the proxy url and proxy port to my own data.

When i try to run the above script, it returns false on the $data. Is there
some special configurations to be done on the server?

I am using PHP Version 4.4.8 and the curl installed on the server is
libcurl/7.16.0 OpenSSL/0.9.7m zlib/1.2.3.

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-06-30