Introduction and Prerequisites
Hello everyone. In this video, I'm going to show you how to install Laravel on Windows 11. Okay, let's get started. Let's open Google Chrome and then search for Laravel.
Okay, click on Laravel official website and then click on documentation. Scroll down. So this is how you install Laravel on your computer. So you need to install PHP and Composer on your computer.
Installing PHP with XAMPP
Okay, let's go to XAMPP to install PHP on our computer. Okay, click over here. XAMPP is the software package that includes PHP, MariaDB, Perl, and Apache server. Okay, click on download over here.
And then I recommend you to download version 8 of PHP because Laravel 9 only supports PHP version 8. Okay, click on download over here. So if the download doesn't start automatically, you can click here and click on download the latest version over here.
XAMPP Installation Walkthrough
Okay, you can close this one and close this one. The file is quite big, it's 147 megabytes, so it's going to take for a while depending on how fast your internet is. Okay, after the download is done, you click over here and click on show in folder and double-click on the files to install the file on your computer.
Click on Yes. Click OK. Click on Next and click on Next, and click on Next and click on Next, and click on Next. The installation will take for a while.
Configuring and Troubleshooting XAMPP
Okay, then click on Finish. Then the XAMPP control panel will pop up. You can start Apache or you can start MySQL.
And then you can close it, or you can right-click over here and quit to access the software. So if you see an error like this, I will tell you how to solve it.
Solving the XAMPP Admin Permissions Error
I'll close the program. Okay, this is how you solve it. After you close it, you go to C drive and go to XAMPP folder and scroll down. You will see xampp-control. Right-click on these files and go to Property and then go to Compatibility and then check on 'Run this program as an administrator'. Click on Apply and click on OK.
So let's open XAMPP again. Click on Yes. Okay, if you close it, and then you go here and quit it, so you see no error right now. Let me close this one. And then if you see this pop up, just click 'Allow access', and this one too, 'Allow access'.
Installing Composer
And the next thing that you have to install is Composer. Okay, let's click on Composer over here and then download the composer. And then click on composer-setup.exe. We can go back to Laravel documentation. And then over here you will see composer-setup.exe files. Show in folder. Click on the files.
Click over here, 'Install for all user.' Click on yes. Click on next. And then you have to make sure that a PHP path is correctly here. It's in C drive, and XAMPP, PHP, and php.exe. And then click on 'Add this PHP to your path'. Okay, click on next, and click on next, and click on install. Click on next, and then click on Finished.
Verifying the Composer Installation
Close this one. Okay let's check if composer is installed. Let's go to terminal. Okay, Windows Terminal and then type composer.
Okay, if it shows something like this, that does mean Composer is installed correctly. So right now we are using Composer version 2.4.4.
Installing Node.js
Okay, you can close it. The next thing that they recommend is Node.js, so you can install it on your computer as well. So the installation is pretty simple. Just click download the long-term version. When the downloads is done, just show in the folder, double-click on the files, and click Next. Check it and then click Next, Next, Next, Next, Install. Click on Yes. Finish. Okay, Node is installed on our computer right now.
Creating a New Laravel Project
Okay, the next thing you have to run this command. This command is a Composer command that's used to install Laravel on your computer. Okay, copy it.
Okay, let's go to drive C and go to XAMPP, and then let's go to htdocs here. And then right-click here and click on Open in Terminal. Okay, make sure XAMPP is open. Okay, and you have to make sure that Apache is running and MySQL is running as well. For MySQL, it doesn't matter, but just make sure it's running. So you can close this one, and then just paste the command over here.
Running the Laravel Installer
So we are going to create a new Laravel project, and the name of the project is example-app. You can change this name to whatever you want. For example, I'm going to change this to sample-laravel-app. Hit Enter.
So it's going to download Laravel and install on this folder for me. See, you will see sample-laravel-app, but you have to wait until it's done so you can access the folder and running the application. If you install this for the first time, it's going to take for a while because it has to download everything on the internet.
Running the Artisan Development Server
Okay, the installation is done. You can access the folder by typing cd and the folder name. For example, cd sample-laravel-app. Hit Enter. Okay, then go back to the documentation. Then you can run php artisan serve.
php artisan serve. So if you click on over here, you will see that our application is running on IP 127.0.0.1 and port 8000. See, this is our application. So this is a Laravel application. And this is the folder of the code. You can open this code with Visual Studio Code. So if you have Visual Studio code, you can open the folder with this code editor.
Okay, I highly recommend you use this text editor. Click on here to download it. If you have it on your computer, you don't have to download it and install it. And if you want to stop this Laravel server, you just type Ctrl-C on your keyboard.
Managing the Server & Opening in VS Code
And the application is stopped. If you go back to the application here and you refresh it, you won't be able to access the application because it's already stopped. So to start the server again you can type php artisan serve. Then the server will be running on this IP number and Port. You can press Ctrl and click on this link on the keyboard to open it on the web browser. So you will see it over here.
All right. If you want to open this folder with Visual Studio Code... okay, let's open Visual Studio Code, and then you just drop this folder over here. Okay, click on 'Yes, I trust the authors'. Okay, this is the code of the Laravel application that we've installed on our computer.
Alright, this is all about this tutorial. If you like this video, don't forget to click like, subscribe, and comment down below. Thank you so much for watching.