APNS PHP的错误"无法连接到APNS:110连接超时"。 [英] Apns php error "Failed to connect to APNS: 110 Connection timed out."

查看:550
本文介绍了APNS PHP的错误"无法连接到APNS:110连接超时"。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做APNS code从这个 APNS code

I have done apns code for php and objective c from this Apns code

和<一个安装证书href=\"https://blog.serverdensity.com/how-to-build-an-apple-push-notification-provider-server-tutorial/\"相对=nofollow>此链接

发送通知iOS设备沙箱生产APNS工作完全在我的server.I移动code和相同的证书客户端服务器,然后发送通知是行不通的。

Sandbox and production apns for sending notification to ios devices is working perfectly on my server.I moved code and same certificate to client server then sending notification is not working.

我调试所有的PHP code和发现它停在这行code的

I debug all php code and found that it stops at this line of code

private function _connectSSLSocket($development) {
    $ctx = stream_context_create();
    stream_context_set_option($ctx, 'ssl', 'local_cert', $this->apnsData[$development]['certificate']);
    $this->sslStreams[$development] = stream_socket_client($this->apnsData[$development]['ssl'], $error, $errorString, 100, (STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT), $ctx);
    if(!$this->sslStreams[$development]){
        $this->_triggerError("Failed to connect to APNS: {$error} {$errorString}.");
        unset($this->sslStreams[$development]);
        return false;
    }
    return $this->sslStreams[$development];
}

apns.log文件显示错误无法连接到APNS:110连接超时

apns.log file shows the error "Failed to connect to APNS: 110 Connection timed out."

没有得到错误。为什么这个错误我收到并且不发送通知iOS设备?任何人都可以指导我这个?

Not getting the mistake. Why this error am i getting and not sending notification to ios devices ? Can anyone guide me for this ?

推荐答案

最后我把VPS,而不是共同主办。
Lucabro的评论帮助我解决。感谢Lucabro。

Finally i took vps instead of shared hosting. Lucabro's comments helped me to solve. Thanks Lucabro.

这篇关于APNS PHP的错误&QUOT;无法连接到APNS:110连接超时&QUOT;。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆