gpt4 book ai didi

php - 如果无法使用端口 2195,如何使用 Apple Push Notifications?

转载 作者:可可西里 更新时间:2023-11-01 12:49:51 24 4
gpt4 key购买 nike

我已经使用 stream_socket_client() 开发了一个脚本,它可以在我的本地主机上运行,​​但是当我尝试在线使用它时(通过 Fatcow.com 虚拟主机)它赢了工作。我收到以下错误:

Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Connection refused) in .../send-notification.php on line 18 Failed to connect 111 Connection refused

这是第 18 行:

$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);

我知道 .pem 文件的密码是正确的。问题是如果我不能使用这个端口我该怎么办?我可以使用任何免费服务吗?我知道80端口是开放的。

我听说使用 curl() 函数会起作用,但到目前为止还没有成功。

我真的很感激能指出正确的方向。

最佳答案

为了向设备发送通知需要在防火墙中启用 2195 端口。出于安全原因,一些组织在防火墙中禁用了这些端口。2196端口用于反馈服务,该端口也应在防火墙中开放。如果不打开这些端口,消息将无法传送到 APNS。

关于php - 如果无法使用端口 2195,如何使用 Apple Push Notifications?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19394215/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com