curl-and-php
Re: curl-and-php Digest, Vol 16, Issue 5
Date: Thu, 19 May 2005 12:23:51 +0200
----- Original Message -----
From: <curl-and-php-request_at_cool.haxx.se>
To: <curl-and-php_at_cool.haxx.se>
Sent: Thursday, May 19, 2005 12:00 PM
Subject: curl-and-php Digest, Vol 16, Issue 5
> Send curl-and-php mailing list submissions to
> curl-and-php_at_cool.haxx.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://cool.haxx.se/mailman/listinfo/curl-and-php
> or, via email, send a message with subject or body 'help' to
> curl-and-php-request_at_cool.haxx.se
>
> You can reach the person managing the list at
> curl-and-php-owner_at_cool.haxx.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of curl-and-php digest..."
>
>
> Today's Topics:
>
> 1. Curl and proxy (Tommaso Trani)
> 2. Re: Curl and proxy (Daniel Stenberg)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 18 May 2005 14:50:11 +0200
> From: "Tommaso Trani" <trani_at_softwareplanet.net>
> Subject: Curl and proxy
> To: <curl-and-php_at_cool.haxx.se>
> Message-ID: <000f01c55ba8$214a06a0$0101a8c0_at_dragon>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
> I'm trying to use curl with php to fetch webpages through proxies, but
I'm unable to do it.
>
> I've tried this code:
>
> <?
> error_reporting(E_ALL);
> $ch = curl_init ();
> curl_setopt ($ch, CURLOPT_URL, "http://www.google.com/");
> curl_setopt ($ch, CURLOPT_TIMEOUT, 20);
> curl_setopt ($ch, CURLOPT_PROXY, "24.44.68.212:5542");
> curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
> curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
> curl_setopt ($ch, CURLOPT_FAILONERROR, true);
> curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
> $result = curl_exec($ch);
> print curl_errno ($ch);
> print $result;
> curl_close ($ch);
> ?>
>
> But I've the following errors/notices:
>
> Notice: Use of undefined constant CURLOPT_PROXYTYPE - assumed
'CURLOPT_PROXYTYPE' in c:\documents and
settings\tommaso\desktop\siti\scambiolink\proxy.php on line 7
>
> Notice: Use of undefined constant CURLPROXY_SOCKS5 - assumed
'CURLPROXY_SOCKS5' in c:\documents and
settings\tommaso\desktop\siti\scambiolink\proxy.php on line 7
>
> On my system I've installed libcurl/7.11.2 OpenSSL/0.9.7c zlib/1.1.4 with
php 4.3.9 and on http://it2.php.net/curl_setopt I read that this options are
available in CURL 7.10 (my version is greater)
>
> Could you please help me?
>
> Thanks
> Tom
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
http://cool.haxx.se/pipermail/curl-and-php/attachments/20050518/1d69b8bc/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Wed, 18 May 2005 15:01:29 +0200 (CEST)
> From: Daniel Stenberg <daniel-curl_at_haxx.se>
> Subject: Re: Curl and proxy
> To: Programming PHP/CURL <curl-and-php_at_cool.haxx.se>
> Message-ID: <Pine.LNX.4.63.0505181459500.23482_at_yvahk3.pbagnpgbe.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Wed, 18 May 2005, Tommaso Trani wrote:
>
> > Could you please help me?
>
> Almost exactly one year ago, we got a very similar question and my reply
is
> still the same:
>
> http://curl.haxx.se/mail/archive-2004-05/0101.html
>
> This option is supported by libcurl all right, but apparently not by PHP.
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
>
Hi,
I saw that thread; but it can't help me very much.
You could help me giving the numeric values of the constants:
CURLOPT_PROXYTYPE and CURLPROXY_SOCKS5
Thanks
Tommaso
Received on 2005-05-19