php curl代理不能与Godaddy共享主机 [英] php curl proxy not work with Godaddy shared hosting

查看:150
本文介绍了php curl代理不能与Godaddy共享主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是我的代码:

  $ url ='http://checkip.org'; 
$ proxy ='202.203.132.26:3128';
$ ch = curl_init();
curl_setopt($ ch,CURLOPT_URL,$ url);
curl_setopt($ ch,CURLOPT_VERBOSE,1);
curl_setopt($ ch,CURLOPT_PROXY,$ proxy);
curl_setopt($ ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ ch,CURLOPT_HTTPPROXYTUNNEL,true);
curl_setopt($ ch,CURLOPT_PROXYTYPE,CURLPROXY_HTTP);
curl_setopt($ ch,CURLOPT_TIMEOUT,60);
curl_setopt($ ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ ch,CURLOPT_RETURNTRANSFER,true);
echo curl_exec($ ch);


它显示我的IP总是72.167.232.25或72.167.232.26。
虽然我改变了$ proxy与差异价值。



我已经检查了我的电脑和这项工作。



我错过了什么?

解决方案

不幸的是,我们不允许在这个特定端口上的入站或出站访问。您处于共享托管环境中,因此可用的端口有限。但是,您将能够使用HTTP端口80连接到服务器。此外,如果您安装了SSL服务器,则可以使用端口443连接到服务器。如果要连接到服务器使用FTP,您将使用端口21,如果您通过SSH连接,您将能够通过端口22连接。遗憾的是,我们无法为您提供共享托管环境中打开和关闭端口的完整列表。 / p>

here is my code:

$url ='http://checkip.org';
$proxy='202.203.132.26:3128';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_VERBOSE,1);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec ($ch);

when run it. it show my IP is always 72.167.232.25 or 72.167.232.26. although I changed $proxy with difference value.

I had check it with my computer and this work .!!

Does I missing something ?

解决方案

Unfortunately we do not allow inbound or outbound access on this particular port. You are in a shared hosting environment so available ports are limited. You will, however, be able to connect to the server using the HTTP port, port 80. Additionally, if you have an SSL server installed, you will be able to connect to the server using port 443. If you are connecting to the server using FTP, you will be using port 21, and if you are connecting via SSH, you will be able to connect via port 22. Unfortunately, we cannot provide you with a comprehensive list of open and closed ports on the shared hosting environment.

这篇关于php curl代理不能与Godaddy共享主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆