2

Hi I have installed PHP 7.1.1 in my Windows OS and also installed Composer as a dependency manager of PHP. Then i installed Laravel using the command:

composer global require "laravel/installer"

But after that when i try to create a project using the command

composer create-project --prefer-dist laravel/laravel test_blogs

I get the following error:

**Installing laravel/laravel (v5.3.16) - Installing laravel/laravel (v5.3.16) Loading from cache Created project in test_blogs

php -r "file_exists('.env') || copy('.env.example', '.env');" 'php' is not recognized as an internal or external command, operable program or batch file. Script php -r "file_exists('.env') || copy('.env.example', '.env');" handling the post-root-package-install event returned with error code 1**

Here one thing to mention that i am not using XAMPP or WAMPP. And current MySQL is also not installed in my system

  • 1
    Possible duplicate of [php is not recognized as an internal or external command in command prompt](http://stackoverflow.com/questions/31291317/php-is-not-recognized-as-an-internal-or-external-command-in-command-prompt) – castis Jan 20 '17 at 21:07
  • Just a question why would you install Laravel with out xampp or mysql – Maytham Fahmi Jan 20 '17 at 21:15
  • Cause i don't need to work with Database now. I i will run it to server later. – Md Muntasir Zitu Jan 20 '17 at 21:19

1 Answers1

1

Add php executable path to your PATH variable of your OS, i.e. in windows generaly

Go to MyComputer->properties->Advanced system setting >Environment Variables> Select PATH and Click Edit

and insert the path of the php end of the line and Save it.

Restart your CMD and type php -v it should give you the PHP version

msonowal
  • 1,553
  • 3
  • 17
  • 36