Hello Coders !! This tutorial is about How to install laravel 5.X in your ubuntu system using the terminal commands.
Laravel uses a composer for managing dependencies.
Step 1 : Install Composer
The first step is to install composer
The first and foremost thing is to make sure that you have a composer already installed in your local system. You can check this by typing “composer” in command.
Already installed composer should look like this.
If a composer is not in there in your system.
Stpe 2 : Install Laravel
The initial step for Laravel 5.X installation
Open the directory path in your terminal.
There is a possibility that you were unaware about your working directory. In your operating system ubuntu this directory structure will be like this “/var/www/html/(project)”.
The directory structure can depend on your local system setup.
composer create-project laravel/laravel --prefer-dist
Let’s write the folder name “laravel” therefor in the laravel folder the setup will be installed just like below screenshot.
After the installation output of installation, the command is shows like above and is there is no error that means the Laravel framework successfully installed in the “
Now move to installed Laravel directory.
Step 3 : Database Setup
MySql database setup
Open the “.env” from the root directory and add the database credential there.
It will look like this
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=database DB_USERNAME=root DB_PASSWORD=123
Here you can add your database name, username, and password, etc.
Step 4 : Composer Install
This command will install all the required dependencies.
Step 5 : Run Laravel
Let’s serve the Laravel using below typed command
php artisan serve
Step 6 : Run Setup
You are almost ready now just follow this step.
Now copy the URL from the above screenshot and open that URL in the browser.
You can see the below screen, it implies Laravel has been installed successfully.
Congratulations you have successfully installed Laravel and now you know how to install Laravel 5.this. For more Laravel articles visit this Link
Here is the video link of the tutorial How to install Laravel 5.X:-