How to Install Laravel on Ubuntu 18.04
Laravel is an open-source PHP web application structure with expressive, exquisite punctuation. Laravel permits you to effectively assemble adaptable and adaptable web applications, soothing APIs and eCommerce arrangements.
With work in highlights, for example, directing, verification, meetings, storing and unit testing Laravel is a system of decision for some PHP engineers.
In this instructional exercise we will tell you the best way to introduce Laravel on a Ubuntu 18.04 framework. Similar directions apply for Ubuntu 16.04 and any Ubuntu based dispersion, including Linux Mint, Kubuntu and Elementary OS.
Prerequisites
Prior to proceeding with this instructional exercise, ensure you are signed in as a client with sudo advantages .
Update the framework bundles to the most recent forms:
sudo apt update && sudo apt upgrade
Installing PHP
PHP 7.2 which is the default PHP form in Ubuntu 18.04 is completely upheld and suggested for Laravel 5.7.
Run the accompanying order to introduce PHP and all necessary PHP modules:
sudo apt install php7.2-common php7.2-cli php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-mbstring php7.2-bcmath php7.2-imap php7.2-xml php7.2-zip
Installing Composer
Arranger is a reliance director for PHP and we will utilize it to download the Laravel center and introduce all fundamental Laravel parts.
To introduce author around the world, download the Composer installer with twist and move the document to the/usr/nearby/canister catalog:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Confirm the establishment by printing the arranger variant:
composer --version
The yield should look something like this:
Composer version 1.8.0 2018-12-03 10:31:16
Installing Laravel
At the hour of composing this article, the most recent stable rendition of Laravel is form 5.7.
Run the Composer make venture order to introduce Laravel in the my_app index:
composer create-project --prefer-dist laravel/laravel my_app
The order above will bring all required php bundles. The cycle may take a couple of moments and on the off chance that it is effective the finish of the yield should resemble the accompanying:
Package manifest generated successfully.
> @php artisan key:generate --ansi
Application key set successfully.
Now you have Laravel introduced on your Ubuntu framework.
When introduced through Composer, Laravel will naturally make a record named .env. This documents incorporates custom arrangement factors including the information base accreditations. You can peruse more about how to arrange Laravel here .
You can begin the advancement worker by exploring to the Laravel venture registry and executing the craftsman serve order:
cd ~/my_app
php artisan serve
The yield will look something like this:
Laravel development server started: <http://127.0.0.1:8000>
Laravel can utilize SQLite, PostgreSQL , MongoDB or MySQL/MariaDB information base to store all its information.
On the off chance that you need to utilize Laravel Mix to gather resources you'll have to introduce Node.js and Yarn .
Verifying the Installation
Open your program, type http://127.0.0.1:8000 and expecting the establishment is fruitful, a screen like the accompanying will show up:
Conclusion
Congrats, you have effectively introduced Laravel 5.7 on your Ubuntu 18.04 machine. You would now be able to begin building up your application.
On the off chance that you have questions, don't hesitate to leave a remark beneath.