Reputation: 53
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
Upvotes: 2
Views: 5036
Reputation: 149
You can run laravel installing php on your local machine (windows) but some depeding package inside laravel will not work properly we have to manually config php.ini file inside executable path insted of doing that you can use laravel homestead
https://laravel.com/docs/10.x/homestead
Upvotes: 0
Reputation: 1687
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
Upvotes: 1