How to install Laravel via Laravel Installer on Windows?
I’m trying to install the Laravel Framework on Windows with the Laravel Installer method.
In the documentation I found the following:
First, download the Laravel installer using Composer. Make sure to place the “~/.composer/vendor/bin” directory in your PATH so the laravel executable is found when you run the laravel command in your terminal.
Now this PATH does not look familiar to me. Could you tell me the working path for Windows?
BTW: I’m using WAMP. Composer is installed and updated.
The PATH for Windows:
I’ve found the location where composer stores the Vendor files.
So instead of ~/.composer/vendor/bin
, on Windows the following path should be used:
C:\Users\<COMPUTER NAME>\AppData\Roaming\Composer\vendor\bin
How to install the Laravel Installer: =======
I assume you have php and composer in your PATH already.
First of all install the Laravel Installer. Open a command prompt and enter:
composer global require "laravel/installer=~1.1"
**Then update the PATH environment variable** via e.g. command prompt with admin privileges:
set PATH=%PATH%;%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
// setx /M path "%path%;%appdata%\Composer\vendor\bin" (this may destroy your system)
%appdata% is added, so you don’t have to worry about adding your computer name.
How to create a fresh Laravel Installation:
Now you should be able to run laravel commands in the command prompt.
To create a fresh laravel installation, open a command prompt in the directory of choice and enter:
laravel new name_of_directory
If everything went right, you should see the following message:
Crafting application...
Application ready! Build something amazing.
Use Laragon (http://laragon.org/)
Install Laragon.
Use Laragon Menu to create project
Take you 5 minutes to have Laravel4 o Laravel5.
Launch Laragon Project
Laragon automatically create Virtual host for your project name ( project_name.me)
Hope it helps.
Source: https://innopy.wordpress.com/2015/02/07/laravel-windows/
If you are having trouble using the command prompt, use the GUI approach:
The path in Windows is:
C:\Users\UserName\AppData\Roaming\Composer\vendor\bin
In the above path "UserName" is your user name that you are logged in your computer as. If you don't know your username, go here: http://library.queensu.ca/libguides/computers/windows-username-check.htm
Copy the above path, replace the "UserName" with your username.
Then go to your computer's environment variables. Here's how:
- Right click on your Computer and go to properties
- Go to Advanced system settings
- Under Advanced Tab, Click on Environment Variables
Under User Variables
, select Path
and click Edit
:
Put a semicolon at the end of the existing text and paste your path, example:C:\ProgramData\ComposerSetup\bin
. Press OK ...
Restart your command prompt and type laravel
and hit enter. If the path was successfully set, you will see "Laravel Installer Version ... "