繁体   English   中英

Magento索引器通过ssh运行但不是cron作业

[英]Magento indexer running via ssh but not cron job

我可以使用以下代码通过ssh命令行重新索引magento索引:

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

或带有此代码的单个索引:

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

而且效果很好。 但是,每当我尝试通过cron重新索引时,都会得到以下信息:

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

有任何想法吗? 谢谢

尝试将路径添加到PHP。 尝试这个:

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

这将取决于您的PHP路径!

您需要向我们提供索引器的名称

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

indexer_code如下所述。 例如//重新索引所有索引

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

以下是索引器代码列表

catalog_product_attribute     Product Attributes
catalog_product_price         Product Prices
catalog_url                   Catalog URL Rewrites
catalog_product_flat          Product Flat Data
catalog_category_flat         Category Flat Data
catalog_category_product      Category Products
catalogsearch_fulltext        Catalog Search Index
cataloginventory_stock        Stock Status
tag_summary                   Tag Aggregation Data

sulman的答案有效,但仅当您通过ssh中的crontab -e命令添加它时才有效。 不确定这是否归因于权限。 就我而言,indexer.php有755

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM