Now day laravel is most favorite php framework. It is easy to use and capable to do one think in various ways. For laravel installation we need to some software like xampp for apache server, Composer for dependency management. Follow these step for laravel installation.
Step: 1 Install xampp
Go to the Xampp website and download the latest page.
after the installation of xampp click on xampp-controll.exe. now xampp local server are working.
Step: 2 Set php.exe path to window globe environment variable
Now you need to add you php path to globe environment variable or cmd. you can article for window Add PHP to Your Windows Path Variable for more information you can take help from google.
Step: 3 Install Composer
Now you need to composer install. Click here to go for download page composer and install.
after the installation check the version of composer with the help of cmd Cammand.
Step: 4 Laravel install by Cmd
After installation of composer, Laravel documentation are provides us two method for install laravel.
1: Via Laravel Installer
In this method you need to install laravel Installer on your machine. for install laravel installer use below command.
composer global require laravel/installer// also make your php $path are set on system environment variable.
after that you can use few line code here no need to install every time to download. For creating new project use below line code.
laravel new <your-project-name>
laravel new laravelnewproject after run this command it installed lot of dependency packages itself.
when downloading is stop then go to the corresponding folder. Like we created laravelnewproject now cd <your-folder-name>, in our case
now laravel are installed you check it with this command.
php artisan serve
it show some line of code whenever its ready to use. like
Starting Laravel development server: http://127.0.0.1:8000
[Tue Nov 10 17:39:30 2020] PHP 7.4.1 Development Server (http://127.0.0.1:8000) started
Open in Browser
just typed this url (http://127.0.0.1:8000) on browser getting from the CMD.
2: Via Composer Create-Project
This is the another way to install laravel on you machine. In this method composer are install the laravel. for laravel installation you can use belowe code.
composer create-project --prefer-dist laravel/laravel <your-project-name>
In our case we create laravernewproject2 check in below.
After Download all dependency by composer goto the corresponding folder and run this command.
php artisan server
open in your browser.