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

1

6 Answers 6

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

1
  • 2
    You can also simply CD to the magento folder in the wamp directory and run the command php bin/magento indexer:reindex Commented Jun 17, 2016 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.

4
  • 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. Commented Jun 10, 2016 at 10:25
  • Is it's working for you ? Commented Jun 10, 2016 at 10:42
  • Yes it is working fine Commented Jun 10, 2016 at 10:48
  • Please accept the answer for right answer it will help other users.Thanks Commented Jun 10, 2016 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

1
  • Hi, I hear about composer a lot, but i never tried and used it. Can we use Composer in windows 8 ? Commented Jun 10, 2016 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.