I have an issue when connecting php and only php to the sphinx daemon. I have tested the sample sphinx php example test.php and narrowed it down to being a connection problem.
I have the follow piece of code which shows the problem,
<?php
$fp = @fsockopen ( '127.0.0.1', '9312', $errno, $errstr,300 );
if(!$fp) {
echo "$errstr ($errno)";
}
?>
Whenever it runs from command line or browser I get the following error,
Connection refused (111)
I have verified the following,
- searchd is indeed running and on port 9312
- searchd can be connected to using telnet
- searchd can be connected to using test.py in the sphinx api
- php can connect to port 80
It is running on a Westhost VPS which seems to be the issue since it works fine on my local test machine. I have existing code which was using Python to run searches against the index without any issues so this one has me well and truly stumped.
Some additional info,
PHP 5.2.5 Sphinx 0.9.9-release
Anyone have any ideas how I could diagnose and fix this issue further?