How to install Laravel 5 with Xampp using Composer
In this article, we are discussing how to install Laravel 5 with xampp using composer. I’m assuming you are familiar with the xampp.
You will need to make sure your server meets the following requirements:
- PHP >= 7.1.3
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
- Ctype PHP Extension
- JSON PHP Extension
For more details, you can check the Laravel official documentation.
Laravel Installation
In Laravel, Composer is used to managing its dependencies. So composer is required in your system. Composer is a tool for dependency management in PHP. It allows you to declare the libraries in your project. In Windows, we can install it easy going to the official page and You can download the installer here.
After installing it, you can open a Windows terminal or git bash and write composer to execute the command:
Now, we are ready to install the Laravel framework using composer command. Firstly, we need to navigate to the htdocs folder in terminal then run this following command.
composer create-project laravel/laravel larablog --prefer-dist
In this above command, we are using composer create-project command. And laravel/laravel is a package which we want to install. ‘larablog‘ is a project folder name and ‘–prefer-dist’ can manage to download the latest stable version of Laravel.
After executing this command, create a folder under htdocs titled ‘larablog‘ with all its dependency.
The available folder structure of Laravel project.
You can manage the dependency with the composer.json file. Which is located in ‘larablog‘ folder.
{ ... "require": { "php": ">=7.1.3", "fideloper/proxy": "~4.0", "laravel/framework": "5.6.*", "laravel/tinker": "~1.0" }, "require-dev": { "filp/whoops": "~2.0", "nunomaduro/collision": "~1.1", "fzaninotto/faker": "~1.4", "mockery/mockery": "~1.0", "phpunit/phpunit": "~7.0", "symfony/thanks": "^1.0" }, ... }
Xampp Virtual Host
I’m using a Virtual Host in Xampp for a Laravel project. And configuring the ‘larablog.dev’ vhost for our project. If you are not familiar with virtual host then follow this guide. This will help you to setup your virtual host.
Everything ready, restart your xampp and run the http://larablog.dev in your browser.
Please check back our other post. Feel free to comments for any query.
If you like our content, please consider buying us a coffee.
Thank you for your support!
Buy Me a Coffee