Need help with Curl And proxy

zozor

Junior Member
Joined
Dec 24, 2008
Messages
113
Reaction score
72
I tried tens of way I still can't get the proxybonanza proxies to work with Curl.
Anyone can show me an example of using a proxy with Curl ?
Any help will be greatly appreciated
 
Well you just have to add this before you call curl_exec.

curl_setopt($ch, CURLOPT_PROXY, "11.11.11.11:8080″ );
curl_setopt($ch, CURLOPT_PROXYUSERPWD,"user:pass");

Do you get an error message or something ?
 
You just have to add this before you call curl_exec.

Code:
curl_setopt($ch, CURLOPT_PROXY, ?11.11.11.11:8080″ );
curl_setopt($ch, CURLOPT_PROXYUSERPWD,?user:pass?);

Do you get an error message or something ?
 
You just have to add this before you call curl_exec.

Code:
curl_setopt($ch, CURLOPT_PROXY, ?11.11.11.11:8080″ );
curl_setopt($ch, CURLOPT_PROXYUSERPWD,?user:pass?);

Do you get an error message or something ?
 
You just have to add this before you call curl_exec.

Code:
curl_setopt($ch, CURLOPT_PROXY, ?11.11.11.11:8080″ );
curl_setopt($ch, CURLOPT_PROXYUSERPWD,?user:pass?);

Do you get an error message or something ?
 
You just have to add this before you call curl_exec.

Code:
curl_setopt($ch, CURLOPT_PROXY, ?11.11.11.11:8080″ );
curl_setopt($ch, CURLOPT_PROXYUSERPWD,?user:pass?);

Do you get an error message or something ?
 
I did that but It does nothing. No error messages nothing
Heres my code
PHP:
$ch=curl_init("www.google.com");
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)');
curl_setopt($ch, CURLOPT_PROXY, "74.55.61.131:61336");
curl_setopt($ch, CURLOPT_PROXYUSERPWD,"user:pass");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data=curl_exec($ch);
print_r($data);
Can you share a working code (I can pay if needed )
 
Last edited:
try this:

Code:
<?php
$url = 'http://somesite.com';
$ch = curl_init();
curl_setopt($ch, curlOPT_URL,$url);
curl_setopt($ch, curlOPT_HTTPproxyTUNNEL, 0);
curl_setopt($ch, curlOPT_proxy, '74.55.61.131:61336');
curl_setopt($ch, curlOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, curlOPT_RETURNTRANSFER, 0);
curl_setopt($ch, curlOPT_CUSTOMREQUEST,'GET');
curl_setopt ($ch, curlOPT_HEADER, 1);
curl_exec ($ch);
$curl_info = curl_getinfo($ch);
curl_close($ch);
echo '<br />';
print_r($curl_info);
?>
 
It still doesn't work I can't get get why. I always get a blank output
 
Did you double check that curl is enlabed on your host ?
You can check that with phpinfo();
And does your host allow outgoing conections ?
 
Try setting the below so you actually get the page back

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
Back
Top