I have issues accessing Sphinx from PHP. I've added php_sphinx.dll to my config, restarted and checked that it is in info() and so far so good. Then configured my Sphinx server, installed the service:
F:\webserver\sphinx\bin>searchd.exe --install --config f:\webserver\sphinx\conf\app.conf --servicename Sphinx
Sphinx 2.2.5-id64-release (r4825)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)
Installing service...
Service 'Sphinx' installed successfully.
Then started the service then built my index
F:\webserver\sphinx\bin>indexer.exe --config f:\webserver\sphinx\conf\app.conf --rotate --all
Sphinx 2.2.5-id64-release (r4825)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file 'f:\webserver\sphinx\conf\app.conf'...
indexing index 'app'...
collected 2 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 2 docs, 13336 bytes
total 0.047 sec, 279862 bytes/sec, 41.97 docs/sec
total 5 reads, 0.000 sec, 5.5 kb/call avg, 0.0 msec/call avg
total 12 writes, 0.000 sec, 3.9 kb/call avg, 0.0 msec/call avg
rotating indices: successfully sent SIGHUP to searchd (pid=3716).
So far no error, everything looks ok, all files created.
Now if I do a php test like:
<?php
error_reporting(E_ALL);
$s = new SphinxClient;
$s->setServer("localhost", 9312);
$s->setMatchMode(SPH_MATCH_ANY);
$s->setMaxQueryTime(3);
$result = $s->query('test');
var_dump($result);
?>
I only get
bool(false)
So I went to do a test in command line:
F:\webserver\sphinx\bin>searchd.exe --config f:\webserver\sphinx\conf\app.conf test
And I get
FATAL: malformed or unknown option near 'test'
So I went to my log file, query.log is empty and searchd.log contains:
[ 4212] listening on 127.0.0.1:9312
[ 4212] WARNING: index 'app': lock: failed to lock F:\webserver\sphinx\data\app.spl: No such file or directory; NOT SERVING
[ 4212] FATAL: no valid indexes to serve
But the file F:\webserver\sphinx\data\app.spl does exist here.
So I have no idea what's going on.