Magento – Cannot initialize the indexer process

indexingmagento-1.9price

I am unable to reindex product prices, it always show the message

Cannot initialize the indexer process.

Best Answer

To resolve the "Cannot initialize the indexer process" you need to run follow below step

Solution 1 :-

This is usually occurred when we Enable "Use Flat Catalog Category" and "Use Flat Catalog Product"

Please connect SSH via Putty run below command:-

These is Individual commands for re-indexing:-

php shell/indexer.php --reindex catalog_category_flat

php shell/indexer.php --reindex catalog_category_product

php shell/indexer.php --reindex catalogsearch_fulltext

OR run all re-indexing:-

php shell/indexer.php --reindexall

Then clear the magento all cache.

Solution 2 :-

Try to run indexing with PHP script file. Create a file reindex_custom.php in the root.

<?php
require_once("app/Mage.php");
Mage::app('default');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
try{
$indexerByShell = Mage::getBaseDir().'/shell/indexer.php';
if(file_exists($indexerByShell))  
 { 
$indexListByCode = array(
"catalog_product_attribute",
                       "catalog_product_price",
                       "catalog_product_flat",
                       "catalog_category_flat",
                       "catalog_category_product",
                       "catalog_url",
                       "catalogsearch_fulltext",
                       "cataloginventory_stock"
    );
        //reindex using magento command line  
        foreach($indexListByCode as $indexer)  
        {  
            echo "reindex $indexer \n ";  
            exec("php $indexerByShell --reindex $indexer");  
        } 
    }
}catch(Exception $e){
    echo $e;
}
?>

Then clear the magento all cache and run this file as http://domain.com/reindex_custom.php

Related Topic