CodeBriefly
Tech Magazine

How to install Laravel 5 with Xampp using Composer

0 4,080

Get real time updates directly on you device, subscribe now.

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:

Install Laravel 5

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.

Install Laravel 5

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

Get real time updates directly on you device, subscribe now.

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRead More