Installing Laravel 5 on XAMPP or Wamp on Windows Platform

Unlike cakePHP or Codeigniter, Installing Laravel is more complicated specially to those new to it. There are several things to configure especially if you are in a Windows platform.

There are things that you should know.
  1. You need internet to conveniently install Laravel. The faster the better.
  2. You need Composer to install Laravel. Download and install the Windows installer based setup.
  3. You need to know your computer’s user name. In my case I’m in windows 10 [C:Users[USER_NAME]AppDataRoamingComposervendorbin]
  4. You need a server, in my case I’m using XAMPP with Apache server. (You may use other php server you want as long as you know where to go).
  5. You can find the official Laravel tutorial at Laravel 5.0 Installation page.

In the Laravel installation page, you have an option to use its own virtual host homestead. But if you are more comfortable using your prefer server then you may go for it.

So let’s get started installing Laravel.

 
First Step: Install Composer

Download and install Composer (Windows Installer).

You should know the directory of your php.exe from your server, as the composer will look for it. for XAMPP users you can go to DRIVE_NAME://xampp/php/php.exe

You can test if composer is successfully installed by going to your command prompt then type ‘composer’. If the command prompt displays list of composer’s commands, then your good to go.

Note: you can’t install it without internet. 

Second Step: Install Laravel via Composer
After you successfully install Composer, in your Command Prompt type ‘composer global require “laravel/installer=~1.1”‘. This will download Laravel to your computer globally so that you can invoke it in any path you want. If the installation fails the first time you may add other commands such as –prefer-dist.

Installing Laravel 5 with XAMPP or Wamp on Windows Platform

Note: the installation duration will depend on how fast you internet connection will be. It may take a minute or more.
 
Fourth Step: Adding Laravel to your computer’s Environment Variable
 

Once Laravel is successfully installed, Open command prompt and change directory to where your xampp/htdocs is. Start a new project by typing. ‘laravel new project_name‘.

Now, you may encounter an error like “laravel is not recognized as an internal or external command, operable program or batch file.

This happens because your system doesn’t know laravel just yet. You may have installed it, but still it doesn’t marry to your system. To solve this problem.

Installing Laravel 5 with XAMPP or Wamp on Windows Platform
  1. You need to identify the current user of your computer. You can find it in control panel user account name.
  2. Once you identified it, paste this code to the address bar of the explorer  [C:\Users\[USER_NAME]\AppData\Roaming\Composer\vendor\bin]. Change the USER_NAME to your user name. Once directory is confirmed, you can now proceed to the next step.
  3. Right click on My Computer->Properties->Advanced System Settings->Environment Variable. In the system variables’ variable, find path. Click edit. Add a semi-colon (no space). Paste the directory C:\Users\[USER_NAME]\AppData\Roaming\Composer\vendor\bin with the right user name. Click ok.
  4. Restart your command prompt and change directory to where your xampp/htdocs is.
Fifth Step: Create new Laravel 5 project

Open command prompt and change directory to where your xampp/htdocs is. Start a new project by typing. ‘laravel new project_name‘.

Installing Laravel 5 with XAMPP or Wamp on Windows Platform
Note: the creation duration of the project will depend on how fast you internet connection will be. It may take a minute or more.
You can access your website. http://localhost/laravel_project/public
Make sure to start your server.

Done! You have successfully install Laravel 5.1 the latest.

Sharing is caring!