Search code examples
phpmagentosshcronindexer

Magento indexer running via ssh but not cron job


I can reindex magento indexes via ssh command line with this code:

php -f [path to store]/shell/indexer.php reindex 

or individual indexes with this code:

php -f [path to store]/shell/indexer.php -- reindex [index]

And that works fine. However whenever i try to reindex via cron i get this:

Usage:  php -f indexer.php -- [options]

--status <indexer>            Show Indexer(s) Status
--mode <indexer>              Show Indexer(s) Index Mode
--mode-realtime <indexer>     Set index mode type "Update on Save"
--mode-manual <indexer>       Set index mode type "Manual Update"
--reindex <indexer>           Reindex Data
info                          Show allowed indexers
reindexall                    Reindex Data by all indexers
help                          This help

<indexer>     Comma separated indexer codes or value "all" for all indexers

Any ideas? Thanks


Solution

  • Try adding the path to PHP. Try this:

    /usr/local/bin/php -q [path to store]/shell/indexer.php --reindex catalogsearch_fulltext
    

    This will depend on your path to PHP though!