APN错误服务器脚本 [英] APN Error in Server Script

查看:638
本文介绍了APN错误服务器脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到我的PHP脚本这个错误,在发送有效载荷数据。

I am getting this error in my php script , while sending payload data.

Warning: stream_socket_client() [function.stream-socket-client]:
Unable to set private key file `/Applications/XAMPP/xamppfiles/htdocs/test/apn/apns-dev.pem'
in /Applications/XAMPP/xamppfiles/htdocs/test/apn/push.php on line 42

Warning: stream_socket_client() [function.stream-socket-client]:
failed to create an SSL handle
in /Applications/XAMPP/xamppfiles/htdocs/test/apn/push.php on line 42

Warning: stream_socket_client() [function.stream-socket-client]:
Failed to enable crypto
in /Applications/XAMPP/xamppfiles/htdocs/test/apn/push.php on line 42

Warning: stream_socket_client() [function.stream-socket-client]:
unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error)
in /Applications/XAMPP/xamppfiles/htdocs/test/apn/push.php on line 42

这是什么原因?我是否需要更改任何设置?
我也安装在服务器.pem文件。

What is the reason ? Do I need to change any settings? I have also installed the .pem file in the server.

感谢

推荐答案

你能不能发布PHP code(push.php)你用连接到APN?

Can you post the PHP code (push.php) you're using to connect to APN?

在黑暗中的一些镜头:

- 是否证书和在那一个.pem文件私钥

- 你是从私有密钥文件删除密码,或者是你在你的PHP code正确设置它

- 请问用户运行的脚本有适当的UNIX权限访问/读取证书/密钥文件

- 可从您的计算机访问苹果公司的服务器?您可以通过运行Telnet测试。

Some shots in the dark:
- Are both the certificate and private key in that one .pem file?
- Did you remove the password from the private key file, or are you setting it properly in your PHP code?
- Does the user running your script have the proper unix permissions to access/read the cert/key file?
- Can you access Apple's server from your machine? You can test by running telnet.

telnet gateway.sandbox.push.apple.com 2195

这篇关于APN错误服务器脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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