Thursday, July 19, 2018

One or more indexers are invalid. Make sure your Magento cron job is running on LocalHost wampserver

This is the error occurred while your WAMP doesn't run the magentos cronjob. If you running the admin of your magento store , you can see this ERROR. One or more indexers are invalid. Make sure your Magento cron job is running.

What is CronJobs ?

Cron Jobs is a scheduled activities, it will automatically run every particular time interval. You can
also able to run by command line.


If you run the admin of your magento store , you can see this ERROR.

One or more indexers are invalid. Make sure your Magento cron job is running.

In Magento we can fix this error by indexing cronjob through command line interface.

If cron is setup in your server magento will automatically indexing all data but in your local
environment cron will not work, so you need to manually run the indexing command from CMD
Use following command to run reindexing.

Window doesnt contains any bat file to run it automatically, so we need to create and configure maually.

Step 1: You have to create yourcronjob.bat file into your phpversions folder.


 Ex: D:/wamp/bin/php/php7.0.29/yourcronjob.bat

In that file you have to add these following lines

D:\wamp\bin\php\php7.0.29\php.exe D:\wamp\www\magento\bin\magento cron:run
D:\wamp\bin\php\php7.0.29\php.exe D:\wamp\www\magento\update\cron.php
D:\wamp\bin\php\php7.0.29\php.exe D:\wamp\www\magento\bin\magento setup:cron:run
D:\wamp\bin\php\php7.0.29\php.exe D:\wamp\www\magento\bin/magento indexer:reindex
D:\wamp\bin\php\php7.0.29\php.exe D:\wamp\www\magento\bin/magento cache:flush


Your cron batfile looks like


Step2: Now you can go to set permission for your user

Select Control Panel\All Control Panel Items\Administrative Tools \Task scheduler \task scheduler library



Click the cron from center of the column, and right click it to open properties window.


You can see change user or group button. Now click that button to set permissions for the user.







In Select user or Group, Enter the object name to select, that means you have to enter your system name. You can find help here.

https://searchengineoptimizationsolutionsarul.blogspot.com/2018/07/finding-your-system-name-on-windows-7.html

Now you can enter your system name and then click check names button, then click ok. and then click ok to close all opened windows. Now you are ready to run cronjob file indexing through command prompt.




Steps to follow to run cronjobs on localhost WAMP using command prompt

Step 1: Find your Wamp server installed directory

Ex: D:/wamp

Step 2: In Wampserver you can find your PHP versions, Now you can check which version you are running.

Go to GREEN color Wamp icon and then click it. Then select PHP and then click to see VERSION of PHP. Note it down.

Step 3: Now note down your magento projects root director

Ex: D:/wamp/www/magento

So we have all necessary data to run cronjob through command line prompt. Now run CMD .

Step 4: Now in Command prompt you go to your PHP versions directory.

Ex: CD D:\wamp\bin\php\php7.0.29

Step 5: Now in Command prompt run the following command php D:\wamp\www\magento\bin\magento indexer:reindex

Ex: D:\wamp\bin\php\php7.0.29>php D:\wamp\www\magento\bin\magento indexer:reindex

now you can see the result . Finally you successfully run cronjon on WAMP. Now you will rerun the admin's index



Best webdesign service

1 comment:

Intructor said...

would you please email me.

i need some help in magento.