Simple Steps To Re-Index Magento Without Shell Access

Simple Steps To Re-Index Magento Without Shell Access

Today many people use various shopping cart scripts to run their stores online and accept orders. We personally use Prestashop, which is a free open source shopping cart script. However, some choose other shopping carts and they range from free ones like Prestashop that are open source, online service shopping cart scripts that cost a monthly fee like Shopify, paid ones that you pay for the shopping cart script all at once like Magento, which is the purpose behind this article. Magento is a popular ecommerce cart and an open source one at that… Freebie!!! However, there are many who find it difficult to use… Don’t feel bad it was for me (the author) too as well. But by far the most important issues I had was getting the re-indexing to run, which is extremely critical to using it as a shopping cart for your business. Not to mention being able to do so without access to the hosting or servers shell or command utility. It is not known if it is just a community version complication or it extends into enterprise version as well, but never fear it will be solved here. But first, a word from our sponsors…

Ha ha ha… Just kidding!!...

The solution to all your problems is extremely simple, which I have added below. All you need to do is create a php file and add a simple one line of code or at least for re-indexing it will be. This line goes as follows, “echo system('php bin/magento indexer:reindex');” after proper formatting. You know the “<?PHP” part, yes that is also needed just to be sure there is no misunderstandings… These things do happen…

echo system('php bin/magento indexer:reindex');

Now, save the file as indexer.php for example and put it into your root folder of your websites server or where the Magento installation is located. You will see folders like “var”, “phpserver”, and “pub” all of which is a sign you are in the right place. Now access the file and it will run the indexer re-indexing all indexes. Wow, that would be a mouthful… Say that three times, “the indexer re-indexing all indexes” “the indexer re-indexing all indexes” “the indexer re-indexing all indexes”. Ha ha ha, did you say it… Good! Now, the last thing it will generate a response about the indexes, which is a sign everything worked as intended with each index responding as successful.

This concludes the article and since we at Programmers Direct know you are very busy.  But before you go. Please check if you found any issues or errors and comment back and tell us about it, as we at Programmers Direct strive for accuracy and want to ensure everything is above standard and high quality. The article’s process was tested on a Linux system only as server access was limited. So, please let us know if it does not work on another server.

Leave a Reply

* Name:
* E-mail: (Not Published)
   Website: (Site url withhttp://)
* Comment:
Type Code