56
votes

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.

7
Forget about the Laravel installer and use Composer - it'll automatically install Composer system-wide (you don't have to fiddle with the PATH manually) and then you can just use it to install Laravel.user2629998
@AndréDaniel That Composer adds itself to the PATH on first installation is true, however I've always used the composer create-project command to install a fresh copy of Laravel and that took quite long to complete. IMO with the Laravel Installer it's a breeze. Did you try out the Installer yourself? It downloads the current release and just copies the files to the new dir each time you run the Installer command, instead of downloading Laravel over and over again. As Laravel has become more stable now, updates don't bubble up as fast as before, making this method work in the long run.Markus Hofmann

7 Answers

107
votes

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

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"

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.

15
votes

Use Laragon (http://laragon.org/) enter image description here

Install Laragon.

enter image description here

Use Laragon Menu to create project

enter image description here

Take you 5 minutes to have Laravel4 o Laravel5. enter image description here

Launch Laragon Project

enter image description here

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/

14
votes

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:

  1. Right click on your Computer and go to properties
  2. Go to Advanced system settings
  3. Under Advanced Tab, Click on Environment Variables

enter image description here

Under User Variables, select Path and click Edit:

enter image description here

Put a semicolon at the end of the existing text and paste your path, example:C:\ProgramData\ComposerSetup\bin. Press OK ...

enter image description here

Restart your command prompt and type laravel and hit enter. If the path was successfully set, you will see "Laravel Installer Version ... "

5
votes

How to install Laravel on Windows using WAMP

  1. Install WAMP first.

I leave everything to default.

  1. Enable OpenSSL and all required extensions in PHP.ini

After you installed WAMP, you need to do this. This is how you make sure OpenSSL is enabled:

On your right hand side of your taskbar, click WAMP and then choose PHP.ini.

And then find php_openssl, and then remove the semicolon in front of php_openssl.

And then, save. Close that file and now go to wamp manager again, and now enable OpenSSL there just to be safe.

After you do that, restart Wamp.

  1. Install Composer

Go to https://getcomposer.org/ and download Windows installer.

The setup will ask for your PHP. if you install your WAMP in default setting, it will usually end up in C:\wamp\bin\php\php5.4.12.

If your installation is successful, by running composer on command prompt, you will see all kinds of info just by running that command.

If you can see it, that means your Composer installation is complete. Let’s move to the next one.

  1. Make sure that your htppd.conf includes httpd-vhosts.conf

Now let’s make sure that your htppd.conf also includes httpd-vhosts.conf. This is beneficial if you want to make a pretty URL just like this one:

Instead of writing up localhost/mylaravel, it would be “nicer” to have that pretty URL, right?

Anyway, let’s go on.

Go to C:\wamp\bin\apache\Apache2.4.4\conf and then open up httpd.conf.

After that, search for httpd-vhosts.conf and make sure that there is no ‘#’ (pound sign) in front of it. Save. After that restart Wamp just to be safe.

Now let’s begin the fun part: installing Laravel.

  1. Install Laravel in specified folder

You usually want to install your Laravel in your www folder. (Obviously!)

So open up your command prompt, and then change directory to your WWW folder inside your wamp. For me it will be: C:\wamp\www

To change directory, just type cd c:\wamp\www

Basically you are changing folder to your www folder.

And then, you can install Laravel. Just use this in your command prompt:

composer create-project laravel/laravel your-project-name –prefer-dist

And then hit enter.

Just wait a while until it is finished downloading and installing.

  1. Enable Laravel installer

If you want to use Laravel Installer, you have to run this command in your command prompt first:

composer global require "laravel/installer"

Wait until… everything finished.

  1. Create Virtual Host

Now let’s create your pretty URL. You have to go to C:\wamp\bin\apache\Apache2.4.4\conf\extra and then open up httpd-vhosts.conf.

After that, you just need to paste the following and change your laravel folder to appropriate ones.

<VirtualHost *:80>
DocumentRoot “c:/wamp/www/mylaravel/public”
ServerName laravel.dev
</VirtualHost>

In my case, I used mylaravel for my laravel installation. You have to change it to something else. For server name, you can change it to whatever you want. In my case, I am using laravel.dev. (You don’t want to use google.com because if you do, you won’t be able to open up Google).

Obviously, you have to save and then restart your WAMP again.

  1. Update Windows Hosts file

After you have changed your virtual host, you need to change your host file.

Go to C:\Windows\System32\drivers\etc and copy hosts and paste it on your Desktop. And click on the host file you have pasted on your Desktop. Open that up using Notepad.

Put this in that host file:

127.0.0.1 laravel.dev

Change laravel.dev into what you already decided in your virtual host file. For me, mine will be laravel.dev.

Copy the one that you modified just now and put it back into your C:\Windows\System32\drivers\etc folder.

You’re done!

Modified from this source: http://copygrammer.com/how-to-install-laravel-on-windows/ (my blog)

2
votes

Installing Laravel framework on window via Laravel installer:

  1. make sure you have composer on your computer.
  2. download the Laravel installer using Composer by typing following code in the command prompt:

composer global require "laravel/installer=~1.1"

  1. go to folder:

C:\Users\ {User Name} \AppData\Roaming\Composer\vendor

  1. copy the vendor folder and paste it into the folder (Destination folder) where you want to install Laravel project; for example, in folder D:\Test\Laravel.

  2. after pasting, your folder structure look like this: D:\Test\Laravel\vendor

  3. pressing down on Shift key and Right click on the folder vendor in your destination folder (D:\Test\Laravel\vendor), and choose "open command window here".

  4. enter the command below:

    laravel new your_project_destination

  5. after the command runs, you will see laravel folder in your_project_destination

1
votes

You can install laravel using Homestead box.

There are a few steps you need to follow.

Make sure that you have windows virtualization turned ON in your BIOS. This will save you a few hours if you are installing it for the first time.

You will also need to install Vagrant and Virtual Box before starting the installation of Homestead.

The main advantages of using Homestead is that it provides a Linux virtual machine where you can easily install packages. It does comes with a lot of packages installed.

http://deepdivetuts.com/installing-laravel-5-4-on-windows-machine-using-homestead

0
votes

If you have not installed composer on your system get from here.

You will get this if you have composer on your system installed

you will get this if you have composer on your system installed

Installing Laravel

Step 1: Installing Laravel globally.

Open cmd in Windows and enter this command.

composer global require "laravel/installer"

This will download the latest version.

installing laravel

Check by entering the below command.

version of laravel

Step 2: Creating a new Laravel Project

Run the below command in cmd, blog is the name of my new project.

laravel new projectname

new laravel project

That's it. Now you have your new project folder in the directory you have saved.