Laravel 5 Installation – how to install it (and quickly!) with XAMPP and Composer

Laravel 5 is great, isn’t it?
Oh, I guess you might not know that yet – considering you are here reading an article about how to install Laravel 5.
XAMPP will be our first stop. Head on over to Apachefriends and grab a copy of XAMPP for your machine (we are assuming windows here, although you might be on another OS); follow the instructions and get that all installed. It’s pretty straight forward. I prefer to install xampp right on the root drive (C: , generally) so that it’s easily organized under C:/xampp/htdocs as my root directory for my projects. This is just personal preference – install to wherever makes sense for you and your workflow.
Well, I suppose now we should bring in Composer now. Laravel uses Composer to manage the packages – it makes life very, very nice and far easier than managing them all manually. So head on over to the composer website and download/install composer on your machine. This is the install page specifically – luckily there are plenty of options for all kinds of folks out there. In case you are windows specific, don’t worry – they have you covered.
Okay, got Composer installed? Great, lets get started.
Open up your command prompt and CD into the directory of your local machine. For me that’s C:/xampp/htdocs
Once there, we are going to get the install started. the following command will create a new laravel project for us.
1 |
composer create-project laravel/laravel new-laravel-install-directory |
For this example, we will create a Laravel 5 installation called ‘myblog’, so our command will look like this:
1 |
composer create-project laravel/laravel myblog |
So, after a few seconds (or minutes, depending on your computer / connection) you will see Composer installing all the requirements and setting up the application in it’s own directory. Once you’re back at the command prompt you will have your laravel 5 app installed! Composer helps to make it that easy.
Here is a snapshot of how your new Laravel 5 installation will look in windows explorer
Now you see the existing file structure that Laravel 5 uses – your Laravel 5 installation is complete!
Want to check to make sure that it’s working? No problem. Lets just start up XAMPP and have a look at the page, shall we?
Open up your XAMPP control panel (start -> type in XAMPP -> Open control panel)
Start the Apache and MySQL services as pictured here:
Next we need to open up your browser of your choice (I will be using Chrome in this example) and head to the location of your Laravel 5 application. The URL will look something like this:
1 |
//localhost/path/to/your-laravel-app/public |
As you may recall – I created mine and called it ‘myblog’ and I created it in my root directory (htdocs) so my path would look like this:
1 |
//localhost/myblog/public |
If you have it in a subdirectory it would look like this:
1 |
//localhost/subdirectory/myblog/public |
Once you put that URL into the address bar of your browser – you should be presented with a very simple screen that says Laravel 5. That’s it!
You’ve installed Laravel 5 – you can get to creating your new web application or website.
If you need further assistance with how to actually utilize Laravel 5 to create your content – you’ll have to understand how the MVC architecture works with web applications and how Laravel 5 has built in structure in place to make it easier for you. It also has some things that make it ‘uniquely Laravel’. A great place to learn a little more about it through some great videos is Laracasts – there is a wealth of knowledge there that can take you from beginning to end. They even have some starter videos showing how to install just as we did here.
If you have some issues or anything else going on with your install – get in touch with us – let us know in the comments below!
Posted on: June 8, 2015, by : adminc