我在我的服务器上有2个以太网eth0和eth1。 默认网关设置为eth0。 我需要在php中使用fsockopen来连接ip 10.10.6.2。 IP 10.10.6.2路由通过eth1(我有一个规则设置在route-eth1)。 当我尝试从系统中ping该ip时,我能够得到响应。 但是,当我尝试fsock打开从IP IP,我越来越超时错误。 我也启用了php.ini中的allow_url_fopen
Warning: fsockopen() [function.fsockopen]: unable to connect to 10.10.6.2:5016 (Connection timed out) in /home/xxxxx/public_html/test.php on line 2 Connection timed out (110)
谁能帮我解决这个问题?
检查你的防火墙以允许10.10.6.2端口5016(或任何你需要连接的端口),你可以从web服务器telnet 10.10.6.2 5016尝试telnet,以确保它能够连接。