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 )!