How to re-index from PHP command line using SSH Print

  • magento, magento 1, index, reindex, ssh, reindex.php, reindex slow, reindex stuck, reindex processing
  • 1

As your Magento store grows in size with more products, orders and customers, you may experience difficulty while re-indexing data through Magento's web admin interface. Fear not - it is possible, and advisable, to run the reindexing through command line using SSH.

  1. Log in to your server or hosting account via SSH, ensuring you use the same credentials as the Magento installation (i.e. never log in with root)
  2. Navigate to /public_html/shell/ folder
  3. Check the status of the indexes to see what needs reindexing
    php indexer.php --status
  4. To reindex all
    php indexer.php --reindexall
  5. Or, find the key names of each index and reindex only the items requiring a reindex
    php indexer.php --info
  6. Running the above will give you a list as follows:
    Product Attributes
    Product Prices
    Catalog URL Rewrites
    Product Flat Data
    Category Flat Data
    Category Products
    Catalog Search Index
    Stock Status
    Tag Aggregation Data
  7. Now choose the key names that require reindexing and run, seperating with a comma if more than one
    php indexer.php --reindex key_name_here
  8. As an example, if we need to reindex catalog_product_flat and catalog_category_product we would choose
    php indexer.php --reindex catalog_product_flat,catalog_category_product
  9. Now we wait until completion - you'll get a message after it's done telling you how long it took to complete

Was this answer helpful?

« Back