GoDaddy Hosting Tip – Using CURL On GoDaddy Shared Hosting
I want to throw a quick tip out there to anyone that plans to use cURL on GoDaddy hosting servers. I've been developing a shopping cart and ported the site from my development server to the hosting server. I ran into a huge problem when trying to get the cart to connect to UPS for real-time shipping quotes. What was the problem? The connection between my PHP (GoDaddy Server) and the UPS server wasn't being made.
After a few
lifetimes hours of searching, I found the answer. GoDaddy requires additional cURL code to use their proxy server. Below is their example of the code you'll need:
$url = 'https://www.paypal.com'; $ch = curl_init(); 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); curl_close($ch);
You can read more here. I know this isn't the usual poetry I post, but one goal with my blog is to save other developers time when possible.