6

When I typed php in my command prompt, It results

C:\Users\samsung>php
'php' is not recognized as an internal or external command,
operable program or batch file.

I have installed xampp in my windows 10 and I haven't edited the php.ini file in the settings. Any help to enable this php command would be greatly appreciated because I am stock in my laravel composer setup due to this.

  • duplicate of http://stackoverflow.com/questions/31291317/php-is-not-recognized-as-an-internal-or-external-command-in-command-prompt – Md. Khairul Hasan Jun 22 '16 at 08:31
  • 1
    Possible duplicate of [How to access PHP with the Command Line on Windows?](http://stackoverflow.com/questions/7307548/how-to-access-php-with-the-command-line-on-windows) – bzeaman Jun 22 '16 at 08:31

3 Answers3

8

If you are using windows:

  1. Open My Computer Properties
  2. Click on Advance System Setting
  3. Select Environment Variables
  4. Click on Path & Edit
  5. Click new & Add your PHP.exe path (e.g. C:\xampp\php\php.exe) As shown in the picture

then Restart

Detail Support available here

5

You should add the php.exe path to PATH environment variable

http://php.net/manual/en/faq.installation.php#faq.installation.addtopath

David Rojo
  • 1,983
  • 1
  • 15
  • 39
1

Install composer, during the installation process allow composer to add php to your path:

https://getcomposer.org/Composer-Setup.exe

Hussain Wali
  • 55
  • 2
  • 9