Gmail 3脚OAuth访问 - Zend_Mail_Protocol_Exception

时间:2010-06-04 21:36:20

标签: php zend-framework oauth gmail

我正在尝试使用Google提供的三条腿Oauth PHP代码('google-mail-xoauth-tools')来访问Gmail:http://code.google.com/apis/gmail/oauth/code.html。我已经注册了我的域名,所有内容似乎都适用于OAuth,但在我授权访问后,我收到此错误:

Fatal error: Uncaught exception 'Zend_Mail_Protocol_Exception' with message
'cannot connect to host; error = Connection refused (errno = 111 )'
     in /home/tchaymor/public_html/gmail/Zend/Mail/Protocol/Imap.php:100
Stack trace: #0 /home/tchaymor/public_html/gmail/Zend/Mail/Protocol/Imap.php(61):           
                  Zend_Mail_Protocol_Imap->connect('imap.gmail.com', '993', true)
             #1 /home/tchaymor/public_html/gmail/three-legged.php(170):
                  Zend_Mail_Protocol_Imap->__construct('imap.gmail.com', '993', true)
             #2 {main} thrown in /home/tchaymor/public_html/gmail/Zend/Mail/Protocol/Imap.php on line 100 

这是我第一次将OAuth与任何Google产品结合使用,因此它可能是我完全没脑子的东西。任何建议都是最受欢迎的(作为更容易替代的建议)。我更倾向于设计师,而不是编码器,所以越简单越好。

1 个答案:

答案 0 :(得分:1)

实际上,这是失败的:

fsockopen('ssl://imap.gmail.com', 993);

有几种选择:
1)该错误表明谷歌正在积极阻止你,也许你已经测试过&失败了一点点,只需等待,直到暂时封锁被解除 2)错误会有所不同,但只是为了确定:allow_url_fopen已启用?
3)本地防火墙? (服务器的telnet imap.gmail.com 993给你什么?)
4)也可以打开OpenSLL库,尝试连接有效的https站点:fsockopen("ssl://google.com",443,$errno,$errstr) or die($errstr);

相关问题