How to enter proxy setting into php_curl?

Answer: To enter the proxy details into php_curl please use the following script.

<?php

$ch = curl_init(‘https://bing.com’);

 

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);

 

curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

 

curl_setopt($ch, CURLOPT_PROXY, ‘proxyIP:proxyPass’);

curl_setopt($ch, CURLOPT_PROXYUSERPWD, ‘proxyUser:proxyPass’);

 

//if you have socks proxies

curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);

 

//if you have http proxies

curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);

 

echo ‘exec=’ . curl_exec($ch);

 

?>

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to enter the proxy details in Stackposts?

Answer: Stackposts can accept proxy details in 2 formats: ·       http://user:pass@ip:port  ·...

How to enter proxy details into GSA?

Answer: For GSA you need to copy the proxy details on to clipboard and copy from clipboard to...

How to enter proxy details into Telegram?

Answer: Enter the proxy details using the following method => Telegram’s Settings ->...

How do I use proxies with Wget and Linux terminal?

Answer: You must specify your proxy on both HTTP and HTTPS sites with the following script -...

How to test your Proxies online?

Answer: We recommend that you use the following test site for your proxies: TestMyProxies.com...