跪求PHP 大神解救有关问题!卡了一个礼拜了!curl代理请求有关问题
Jun 13, 2016 pm 12:03 PM
跪求PHP 大神解救问题!卡了一个礼拜了!curl代理请求问题!
$ch = curl_init();
curl_setopt ($ch, CURLOPT_PROXY,'218.66.66.18:80');
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
curl_setopt ($ch, CURLOPT_URL, 'http://www.baidu.com');
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
curl_setopt ($ch, CURLOPT_AUTOREFERER,1);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
dump($result);
//我去掉端口代理就可以访问到百度,加了代理端口为什么不行!是什么方式不对么?这个端口可以用吧!求大神详细解答感谢!
------解决方案--------------------
218.66.66.18:80 是 新华都商学院本科招生网
并不是什么代理服务器,所以 CURLOPT_HTTPPROXYTUNNEL 就无法建立通道

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solution: Your organization requires you to change your PIN

How to adjust window border settings on Windows 11: Change color and size

How to change title bar color on Windows 11?

How to enable or disable taskbar thumbnail previews on Windows 11

OOBELANGUAGE Error Problems in Windows 11/10 Repair

10 Ways to Adjust Brightness on Windows 11

How to realize the mutual conversion between CURL and python requests in python
