how to set up laravel 8 | how to install laravel on windows 10 | how to install laravel 8? | laravel

153 Aufrufe
Published
how to set up laravel 8 | how to install laravel on windows 10 | how to install laravel 8? | laravel
In this video we are set up the laravel 8 environment. We need to make sure that our server meets the Laravel 8 requirements.

To Install Laravel 8, first we will install Xampp then Composer and finally install Laravel 8.

1) Install Xampp/Wamp :-

You can install latest Xampp as per your Operating System from below link :-
https://www.apachefriends.org/download.html

Make sure PHP version must be greater then or equal to 7.3

You can also install Wamp from below link :-
http://www.wampserver.com/en/

2) Install Composer :-

Composer is a tool for dependency management in PHP. We can install composer from below link :-
https://getcomposer.org/download/

or directly download Composer Setup for Windows :-
https://getcomposer.org/download/

After download the setup, just install it in your Xampp folder at path /xampp/php/ and after installation, you can check in Shell in your Xampp Control Panel if you are using Xampp. Type "composer" and enter, "Composer" related commands you can able to see.

3) Install Laravel 8

After installing Xampp latest version with latest PHP version and Composer as well, now we are ready to install Laravel 8 project.

Simply open below Laravel 8 link and follow instructions :-
composer global require laravel/installer

2 ways to install Laravel 8 :-

via Laravel Installer :-

First, download the Laravel installer using Composer:
composer global require laravel/installer

And then run below command to install Laravel 8 project :-
laravel new project_name

via Composer Create-Project :-
composer create-project --prefer-dist laravel/laravel blog

If in case "Laravel PHP Command Not Found" error comes while installing Laravel 8 with "laravel new project_name" command then try to set the environment variables like below :-

i) Click on the windows button on the bottom left and go to System
ii) Click the Advanced System Settings link in the left column
iii) In the System Properties window, click on the Advanced tab, then click the Environment Variables button near the bottom of that tab.
iv) In the Environment Variables window , highlight the Path variable in the "System variables" section and click the Edit button. Add the path lines with the paths you want the computer to access.
v) Then add below paths to windows PATH environment variables: ;G:\xampp\mysql\bin;G:\xampp\php;
(In my case, Xampp is in G drive so I given G path, you can give your own drive where your Xampp installed)

Now Laravel 8 must be installed with "laravel new project_name" command so exit current Git Bash and go to your project folder and right click on it to run again.

4) Run Laravel by giving below command in project folder :-

php artisan serve

5) Check Laravel version by giving below command :-

php artisan --version

You can see it will show Laravel Framework 8.0.0. It means Laravel 8 version has been installed successfully.

If in case, it shows Laravel 7.0 version or your old version, then do below steps to update it to Laravel 8.0 :-

a) Update composer.json file :-
Update composer.json file located at root of your project to update "laravel framework from 7.0 to 8.0

"laravel/framework": "8.0.*",

b) Run "composer update" command :-
After updating composer.json, you have to run "composer update" command to update Laravel 7.0 to 8.0

c) Run "php artisan --version" command :-
Now you can see; it must show Laravel Framework 8.0.0 when you check Laravel version.

6) Encryption Key Issue (if any)

If such key issue comes, then run below command :-

php artisan key:generate

And then restart laravel server again means close Git Bash and run it again with "php artisan serve" command.

Thanks for watching :)
Kategorien
PC (Windows/Mac/Linux) Anleitungen
Kommentare deaktiviert.