stream_socket_client无法连接(连接超时) [英] stream_socket_client unable to connect (connection timed out)

查看:915
本文介绍了stream_socket_client无法连接(连接超时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用证书和私钥

$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', $certfile);
stream_context_set_option($ctx, 'ssl', 'passphrase', $pass);
$fp = stream_socket_client('ssl://gateway.xyz.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);

它在我的本地XAMPP服务器中运行,但在外部服务器中不起作用:

Its running in my local XAMPP Server, but its not working in the external server:

警告:stream_socket_client()[function.stream-socket-client]:无法连接到/home/biranchi/public_html/中的ssl://gateway.sandbox.push.apple.com:2195(连接超时)第42行的push.php

Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Connection timed out) in /home/biranchi/public_html/push.php on line 42

无法连接110

有什么错误?我需要更改服务器中的某些设置吗?

What is the error? Do i need to change some setting in the server?

推荐答案

我通过打开生产服务器上的端口2195解决了该问题.您可以通过以下命令进行验证:$ telnet gateway.push.apple.com 2195

I had fixed the issue by opening the port 2195 on the production server. You can verify by following command $telnet gateway.push.apple.com 2195

-bash-3.2# telnet gateway.push.apple.com 2195

Trying 17.149.38.141...
Connected to gateway.push.apple.com (17.149.38.141).
Escape character is '^]'.
Connection closed by foreign host.

这篇关于stream_socket_client无法连接(连接超时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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