Magento reindexing problems – Solutions

If you have magento store sure you have seen “There was a problem with reindexing process” error message.If you try to reindex from magento admin panel, all options are not reindexing.There are may be category flat data,product flat data and product prices reindex errors.Here I’ll describes how to solve this reindex problem in the magento store.

Please keep backup files before do these methods.

What are the reasons for magento reindexing error

  • The number of products
  • The number of stores
  • The apache/lighttpd timeout settings
  • There are references to deleted products in catalog_product_flat_% tables
  • The php.ini maximum execution time


1-Backup the table “catalog_category_product_index” with “Disable foreign key checks” marked.
2-Drop that table from the database.
3-Open that mysql file of the table and remove the constraints at the bottom, except “SET FOREIGN_KEY_CHECKS=1;” .Then it look like this.

4-Save and execute that file in that database.
5-Then clear the magento all cache and do the reindexing process in the magento backend.
If not success, do the following Method-2.


1-Increase your execution time value in the .htaccess file.

2-Create a file reindexing.php in the root.
3-Copy the following scripts,paste and save that file.

4-Then clear the magento all cache and run this file as
Note:Sometimes it will take long time because it will reindexing all.If you have shell access do the following method to do this quickly.

php shell/indexer.php reindex all


How to solve “An error occurred while saving the URL rewrite” or “cannot initialize indexer process” problems

1-Goto the magento root directory and goto var/locks directory and delete all the files under it.
2-Change the var/locks folder permission to 777.
3-Run the following mysql query in your database.

4-Clear the magento all cache and try to reindexing process in the magento backend.


1-Log into the phpmyadmin and find “catalog_product_flat_%” tables.Those are

  • catalog_product_flat_1
  • catalog_product_flat_2
  • catalog_product_flat_3

2-Try to truncate/empty those tables.
3-Clear the magento all cache and try to reindexing process in the magento backend.
That’s all.If you have problems,ideas,tips about this put as comments below.