S
S
sorry_i_noob2019-02-05 18:33:51
PHP
sorry_i_noob, 2019-02-05 18:33:51

Why does the "indexer --all --rotate" command give the error "sh: indexer: command not found"?

Hello. Never worked with Sphinx. I need to reindex Sphinx for a site. The site is written in PHP, I don't have access to SSH, I only have FTP.
I created a file with PHP code:

echo exec("indexer --all --rotate 2>&1", $output, $return_val) . '<br><br>';
if ($return_val !== 0) {
  echo "There was an error!<br><br>";
}
echo var_dump($output) . '<br><br>' . var_dump($return_val);

I opened it in a browser and got this error:
sh: indexer: command not found

There was an error!

array(1) { [0]=> string(30) "sh: indexer: command not found" } int(127)

Why is it happening and how to fix it? Is it related to the fact that I'm trying to execute the command command for the Sphinx through php, and not through the terminal?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Volintsev, 2019-02-05
@copist

Specify the full path to the file
/usr/bin/indexer seems

P
Puma Thailand, 2019-02-06
@opium

Why the hell are you making such a fuss, if you have shared hosting, you should usually start reindexing in the panel there

O
Oleg, 2019-02-07
@402d

I just finished tormenting myself with the sphinx on vps.
1) I put from a standard turnip. does not want to connect from php via qli.
I find that there is a known bug for ubuntu 14 and php > 5.4
2) I connect an alternative ppa
Now it doesn't want to start at all.
3) I download from offsite. I put in the user's folder.
does not want to bind on ports. (Problem with OVZ virtualization). I'm changing it to sockets. Ufff.
What is useful for you.
Sphinx hosting can be set as you like. Read hoster's mana.
If the hoster does not provide a reindexing mechanism,
then in the crown we hang the task
/path/indexer --all --rotate --config /path/sphinx.conf

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question