问题描述
最后我发出的通知从我的本地服务器到我的设备。我跟着这个教程的和许多从堆栈溢出人民帮助我达到这个。我谢谢我所有的朋友。
Finally i have sent a notification from my local server to my device. I followed this tutorial http://www.raywenderlich.com/3525/apple-push-notification-services-tutorial-part-2 and many of the peoples from stack overflow helped me to reach this. I Thank you all my friends.
我对服务器设置令人怀疑。对于我的本地使用我用甲基苯丙胺的Apache和MySQL服务器
。最后,我打开SSL航站楼使用certificate.pem和key.pem
。有没有办法从PHP脚本 打开SSL。但是,我不知道PHP的任何一个脚本,因为我是iOS开发者。对不起这一点。
I have one doubt on the server setup. For my local use i have used MAMP for Apache and MySQL servers
. Finally i open the ssl from Terminal used certificate.pem and key.pem
. Is there any way to open ssl from php script
. But, i don't know any single script of php because i am ios developer. Sorry for this.
昨天我用下面的命令在我的终端,打开SSL并连接到APNS,
Yesterday i have used below commands in my Terminal to open ssl and connect to APNS,
unknownc42c032e8297:~ gopi$ /Applications/MAMP/bin/php/php5.3.6/bin/php /Users/gopi/Desktop/PushChatServer/push/push.php development
unknownc42c032e8297:~ gopi$ cd /Users/gopi/Desktop/PushChatServer/push
unknownc42c032e8297:push gopi$ telnet gateway.sandbox.push.apple.com 2195
Trying 17.149.34.66...
Connected to gateway.sandbox.push-apple.com.akadns.net.
Escape character is '^]'.
Connection closed by foreign host.
unknownc42c032e8297:push **gopi$ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert gopiAPNCert.pem -key gopiAPNKey.pem**
Enter pass phrase for gopiAPNKey.pem:
CONNECTED(00000003)
.
.
.
.
Verify return code: 0 (ok)
---
creagx
closed
unknownc42c032e8297:push gopi$ /Applications/MAMP/bin/php/php5.3.6/bin/php /Users/gopi/Desktop/PushChatServer/push/push.php development
^C
有没有办法从我们的PHP文件OpenSSL的?这是可能或终端使用是更好的,是唯一的方法?任何人都可以请帮我在这?先谢谢了。
Is there any way to openssl from our php file? It is possible or Terminal usage is better and is the only way for this? Can anyone please help me on this? Thanks in advance.
推荐答案
要发布到从PHP命令端子输出的,你可以使用的,或。用法这些职能之间略有不同,但他们基本上做同样的工作。
To post the Terminal output from a command to PHP , you can use exec() , system() or passthru(). The usage is slightly different among these functions, but they basically do the same job.
这篇关于从PHP APNS Openssl的连接苹果推送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!