1

I tired to re-index magento 2.0.7 using CMD with command of php bin/magento indexer:reindex but i received php is not recognized as an internal or external command,operable program or batch file.

Please help me in this

6

Try This.
open cmd and run it as administrator.

C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\Magento\www\bin\magento indexer:reindex

hope this will help you.

5

if you are using windows then run this command in cmd

C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\Magento\www\bin\magento indexer:reindex

and if you want to reindex only one indexer then write following command:

C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\Magento\www\bin\magento indexer:reindex indexer_name.

where indexer_name can be found by typing following command :

C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\Magento\www\bin\magento indexer:info

Hope it helps

  • 2
    You can also simply CD to the magento folder in the wamp directory and run the command php bin/magento indexer:reindex – Aravona Jun 17 '16 at 15:11
0

using cmd you can reindex cache. In order to run php client as command in window you need to set php as environment available How to set the env variable for PHP?

After that you can run any of magento 2 cli command from cmd like

php bin/magento indexer:reindex

For more see Here.

  • I followed your steps, also i have to used path setup with one of my java developer. He sets path for me like how we did in java so that the command works proper. – Tharun kumar Jun 10 '16 at 10:25
  • Is it's working for you ? – Arunendra Jun 10 '16 at 10:42
  • Yes it is working fine – Tharun kumar Jun 10 '16 at 10:48
  • Please accept the answer for right answer it will help other users.Thanks – Arunendra Jun 10 '16 at 10:49
0

You have to add PHP in environment variable. There are two ways to add environment variable, through MyComputer property and another is command prompt terminal.

I suggest you to use cygwin software for windows system it works like linux in windows system,

setx PATH "%PATH%;[php bin path]"

After configured PHP in environment variable, you reindex magento using

php bin/magento indexer:reindex
0

Looks like you don't have installed composer in your machine. So first you need to install composer to perform that operation.

Download composer by visiting this link

  • Hi, I hear about composer a lot, but i never tried and used it. Can we use Composer in windows 8 ? – Tharun kumar Jun 10 '16 at 10:53
0

You need to add path of your php.exe file in you environment variable section.

You can add like below:

  1. Right click on My Computer Icon and choose Property then advance settings.
  2. Click on Environment Variable button
  3. In a System variable section select "Path" variable and then click on edit button.
  4. There you will find lot of path to .exe seperated by semicolon. you can also add your php.exe path there.

Restart command prompt to make it effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.