In magento version 1.7.0.2 whenever i tried to reindex data it takes long time and after that it will display 500 Internal Server Error.
-
Could you post the content of your error log file please ?– Raphael at Digital PianismOct 2, 2015 at 11:43
-
where it is located ?– Bishal NeupaneOct 2, 2015 at 11:48
2 Answers
Try to re-index data by ssh
php indexer.php --reindex catalog_product_attribute
php indexer.php --reindex catalog_product_price
php indexer.php --reindex catalog_url
php indexer.php --reindex catalog_product_flat
php indexer.php --reindex catalog_category_flat
php indexer.php --reindex catalog_category_product
php indexer.php --reindex catalogsearch_fulltext
php indexer.php --reindex cataloginventory_stock
php indexer.php --reindex tag_summary
or for all
php -f indexer.php reindexall
Script for re-index data
<?php
require 'app/Mage.php';
Mage::app('default');
$indexCollection = Mage::getModel('index/process')->getCollection();
foreach ($indexCollection as $index) {
$index->reindexAll();
}
Or for individual indexer code you can use below.
<?php
require 'app/Mage.php';
Mage::app('default');
$process = Mage::getModel('index/indexer')->getProcessByCode('catalog_product_price');
$process->reindexAll();
-
is there php script to reindex ? because i don't have cpanel only ftp ! Oct 2, 2015 at 11:10
-
-
-
I have edited script. You can create one file on root of your Magento. Add this script code in file and run that file in browser. try to run code for individual indexer code. If that doesn't work you must try with ssh. Oct 2, 2015 at 12:10
-
Fatal error: Uncaught exception 'Mage_Core_Exception' with message 'Product Attributes Index process is working now. Please try run this process later.' in /home/content/92/11973392/html/app/Mage.php:594 Stack trace: #0 /home/content/92/11973392/html/app/code/core/Mage/Index/Model/Process.php(182): Mage::throwException('Product Attribu...') #1 /home/content/92/11973392/html/reindx.php(7): Mage_Index_Model_Process->reindexAll() #2 {main} thrown in /home/content/92/11973392/html/app/Mage.php on line 594 Oct 2, 2015 at 12:17
It seems the issue of execution timeout of your server, you can try extending it by yourself or by asking hosting provider. Meanwhile, This thread should help you with the reindexing issue, explains well how to do reindexing programmatically.
https://stackoverflow.com/questions/14827996/magento-reindexing-price-programmatically