2

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?

Community
  • 1
  • 1
cornernote
  • 1,055
  • 1
  • 12
  • 20
  • What do you mean "fails"? What happens? What error messages are you getting? If the open fails, PHP should be giving you a warning message with the reason for the failure. – Charles Mar 14 '11 at 04:16
  • Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:3312 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) – cornernote Mar 14 '11 at 04:41

1 Answers1

2

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.

HiTCHO
  • 84
  • 1