Php curl proxy problems

Source: Internet
Author: User
This article describes in detail how to use a socket5 proxy to access Google. it works in command line mode, but the PHP code does not work, and the false code is directly returned and pasted out, ask me how to use CURL proxy in socks5-PHP

Use a socket5 proxy to access Google. it can be used in command line mode, but the PHP code is useless and false is returned directly.
The code has been posted. please help me renew it.

Proxy stringTcp: // 127.0.0.1: 1080Try,

$ Ch = curl_init (); curl_setopt ($ ch, CURLOPT_URL, $ url); curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt ($ ch, CURLOPT_CONNECTTIMEOUT, 3); curl_setopt ($ ch, success, false); curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, false); if ($ this-> proxy) {curl_setopt ($ ch, CURLOPT_PROXY, $ this-> proxy );}

The above is the configuration I used to get google. it can be used normally.

The above is the problem of using CURL proxy in socks5-PHP. For more information, see PHP Chinese network (www.php1.cn )!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.