godaddy端口_GoDaddy,cURL,HTTP和403错误

godaddy端口

I was recently coding PHP cURL functionality for a GoDaddy-hosted website and I kept running into an annoying 403 error. Essentially, GoDaddy's proxy server (which they force you to use for cURL) was giving me a "Forbidden" error and wasn't trying to hit the necessary server. Here's the code that GoDaddy tells you to use for cURL transactions:

我最近正在为GoDaddy托管的网站编写PHP cURL功能的代码,但不断遇到烦人的403错误。 从本质上讲,GoDaddy的代理服务器(他们强迫您将其用于cURL)给了我一个“禁止”错误,并且没有试图击中必要的服务器。 这是GoDaddy告诉您用于cURL事务的代码:


$URL='https://www.paypal.com';
$ch = curl_init();
echo 'URL = $URL <br>n';
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt ($ch, CURLOPT_PROXY,'http://proxy.shr.secureserver.net:3128');
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_URL, $URL);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec ($ch);
echo '<hr><br>n';
echo 'Errors: ' . curl_errno($ch) . ' ' . curl_error($ch) . '<br><br>';
echo '<hr><br>n';
curl_close ($ch);
print 'result - $result';
echo '<hr><br>n';


The problem is that since I'm not using SSL in this instance, I don't need to use the following cURL option:

问题在于,由于我在这种情况下不使用SSL,因此不需要使用以下cURL选项:


curl_setopt($ch,CURLOPT_HTTPPROXYTUNNEL, true);


Remember that if you receive this error from GoDaddy's server. Hopefully I save someone a bunch of time with this.

请记住,如果您从GoDaddy的服务器收到此错误。 希望我可以为此节省一些时间。

翻译自: https://davidwalsh.name/godaddy-curl-http-403-errors

godaddy端口

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值