开发者

PHP fsockopen() fails, but telnet works

I am trying to get Sphinx Search working under Windows7. So far everything is great except PHP cannot connect to the running service.

ONLY TELNET WORKS:

telnet localhost 3312

php: fsockopen("localhost", 3312, $errno, $errstr, 30);

I decided to test some other ports...

BOTH WORK:

telnet localhost 80

php: fsockopen("localhost", 80, $errno, $errstr, 30);

ONLY TELNET WORKS:

telnet localhost 3306

php: fsockopen("localhost", 3306, $errno, $errstr, 开发者_开发知识库30);

Could the reason have something to do with the port being binary data on 3312 and 3306?


Try and use 127.0.0.1 instead of localhost - many times this could show up dependency on the OS to do lookup on the hostname for you. If this works then it isn't PHP it is a linkage between PHP and OS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜