godaddy使用smtp_GoDaddy托管技巧–在GoDaddy共享托管上使用CURL

godaddy使用smtp

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.

我想向打算在GoDaddy托管服务器上使用cURL的任何人快速提示。 我一直在开发购物车,并将网站从开发服务器移植到托管服务器。 尝试使购物车连接到UPS以获得实时运输报价时遇到了一个巨大的问题。 怎么了 我PHP (GoDaddy服务器)和UPS服务器之间没有建立连接。

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:

一个几 辈子 小时的搜索后,我找到了答案。 GoDaddy需要其他cURL代码才能使用其代理服务器。 以下是您需要的代码示例:

$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.

您可以在这里阅读更多内容 。 我知道这不是我经常发表的诗歌,但是我博客的一个目标是在可能的情况下节省其他开发人员的时间。

翻译自: https://davidwalsh.name/godaddy-hosting-curl

godaddy使用smtp

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值