How to install Laravel 5 in Windows with XAMPP

This short tutorial is based on my own installation of Laravel 5 on XAMPP that is running on Windows 7.

In this Laravel 5 tutorial, you will need:

There have been major changes in the following: New Folder Structure, Contracts, Route Cache, Route Middleware, Controller Method Injection, Authentication Scaffolding, Event Objects, Commands / Queueing, Database Queue, Laravel Scheduler, Tinker / Psysh, DotEnv, Laravel Elixir, Laravel Socialite, Flysystem Integration, Form Requests, Simple Controller Request Validation, New Generators, Configuration Cache, Symfony VarDumper.

To learn more about the Laravel 5.0 update, read about it here.

How to install Laravel 5 in Windows with XAMPP

In command prompt, navigate to your XAMPP’s htdocs folder, e.g., C:/xampp/htdocs

Run the following command, replacing <YOUR_FOLDER_NAME> with a folder name of your choice:

composer create-project laravel/laravel <YOUR_FOLDER_NAME> 5.0 --prefer-dist

This will download Laravel 5 on your machine. For this tutorial, let’s assume that you installed Laravel 5 in this path: C:/xampp/htdocs/laravel5, so your command will be:

composer create-project laravel/laravel laravel5 5.0 --prefer-dist

When installation is finished, run the following command:

composer install

This will download and install dependencies, as written in the composer.json in your laravel folder.

This is how my composer install looks like:
laravel-composer-install

When your composer install has finished, you should now be able to view the Laravel 5.0 welcome page.

Start your Apache and MySQL. You might expect to find the site at http://localhost/laravel5, but nope, you are missing a segment in the URL. Go to http://localhost/laravel5/public/ to see this neat welcome page:
laravel-5-installation

Having /public in the URL doesn’t make the prettiest structure, and there’s something we can do to remove that. Find the server.php file in the root folder of your Laravel installation, and rename it into index.php. Then go to the /public folder, and copy the .htaccess file. Paste the .htaccess file into the root folder of Laravel.

Now, try to access http://localhost/laravel5. That should be accessible now.

Start building amazing apps with your Laravel 5.0 installation! 🙂

Related Posts:

Posts that may be related to "How to install Laravel 5 in Windows with XAMPP":

Catzie

An odd human being who happens to have a variety of ever-changing interests, but right now they are programming, making up silly song/rap lyrics, K-pop, drawing, creating unique dessert/drink flavors, obsessing about finding out how some things works, automation, anime, video games... Ran online dessert shops Cookies PH and Catzie's Cakery in her past life.

Leave a Reply

Your email address will not be published. Required fields are marked *