Command prompt error: PHP is not recognized as an internal or external command

Web Development Hits: 48

When installing Magento 2, you may experience the command prompt error: PHP is not recognized as an internal or external command, operable program or batch file.

To fix the error follow the below steps.

  1. In search type Environment Variables

  2. Click Environment Variables button

  3. Click Path to open window

  4. Click New button and add C:\xampp\php (find the correct path by navigating to the xampp\php folder in Windows explorer).

You can now run commands such as php bin/magento setup:static-content:deploy to deploy Magento 2

Print

Related Articles