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的服务器收到此错误。 希望我可以为此节省一些时间。
godaddy端口