Introduction & Prerequisites
Hello guys, welcome to Amit Things. In this video, we will learn how to install Laravel on Windows. Laravel is a PHP framework to create complex web applications.
So, to install Laravel, first install PHP, then install Composer. So let's see first how to install PHP and Composer, then we will install the Laravel framework. Let's start.
First, go to the web browser. We are using Chrome; you can use any web browser. On Google search, type PHP. Press Enter. On pressing Enter, the official website is visible: php.net. Click on it.
So here it is, you can see 8.2 is visible. It is released. Okay. Now I'll directly click on Downloads from here. Now you can see 8.2.0 is visible. We want for Windows, so I'll click on Windows downloads from here. Now the download space is visible. It is having non-thread safe as well as thread-safe versions. Always go for the thread-safe version. So I'll just go for the thread-safe and click on the zip file because it's for x64, that is 64-bit Windows. Click on the zip file. Now download will start for the zip file. Here it is, only 30 MB. Let's wait. It's written Win32, but it hardly matters; it works for 64-bit Windows.
So we have downloaded the zip file. Right-click and click on Show in folder. Here it is. Now what I'll do, I'll just right-click. After right-clicking, I'll just extract it. Okay, extract it.
We have extracted it. I'll right-click and rename it. Here it is, rename. I'll just change it to an easier one, that is PHP 8.2.0. That's it.
Configuring the PHP Environment Variable
When I double-click, here are our files. What I'll do, I'll just right-click and copy this. Copy this. That's it. Now go to C drive. Here it is, we have reached the drive section, C drive. Click on Program Files and right-click and paste the same file. Click on paste. Continue, allow it, because it's an admin drive. Here it is. Double-click and these are our files. Okay, what I'll do, I'll just right-click and copy this path. This is what you need to do to set the path. Minimize.
Now I'll go to Start. I'll type 'environment variables'. Here it is, 'Edit the system environment variables'. Click on Open. System Properties, Advanced tab, click on Environment Variables. Here it is. Under System variables, go to Path section, the following path variable. Double-click. Click on New and right-click and paste the same path which we just copied for PHP. Here it is. That's it. Click on OK, OK, and the last OK to apply it. That's it.
Go to Start, type CMD, click on Open. Here it is. PHP... php --version and press Enter. Here you can see PHP 8.2.0. That means we successfully installed PHP on Windows.
Installing Composer for Windows
Guys, we successfully installed PHP on our system. Now let us install Composer and link them. Composer is a package manager for PHP. So go to the web browser. I'm using Chrome, you can use any web browser. Type Composer, press Enter. On pressing Enter, open the website getcomposer.org.
Here, directly click on Download. Now click on Windows Installer, composer-setup.exe. This will download the setup. Downloaded the exe file, double-click on it to install.
After minimizing, select Install for all users. Installation options, click Next. Herein, it automatically detected our PHP path. We have installed PHP here if you remember. Okay. Here it is, C, Program Files... type P, here it is, PHP 8.2.0, and here is the exe file, php.exe. So this is the path, if you can check it here. Same path. Okay, which is fine. Click Next. Leave it, leave the proxy settings, click Next. Now the Ready to install section, click Install. The summary is visible. Click Next and click Finish.
Verifying Composer & Installing Laravel
Guys, we successfully installed PHP and Composer. Now we'll install Laravel. For that, let's... I'll create a project folder here. New folder. I created this folder. Double-click. Under that, create our first-app folder. Let's say. Open it. Right-click, Open in Terminal. Minimize.
Now type composer global require to install globally, laravel/installer command, and press Enter.
Creating a New Laravel Application
We will create a new app. laravel new demo-app. demo-app and press Enter.
Now guys, we have built the app. Go to the folder, go to First app, under demo app, you can see all the files are visible. Therein, you can check the controller files also.
Running the Laravel Development Server
Now we need to run the server. For that, we need to go inside the app, that is, cd demo-app. That is inside our app. Here it is, we are now going inside here. Okay. Now I'll just type to reach inside it. Now, I'll just run the server: php artisan serve. This will start the inbuilt PHP server. Press Enter.
Now the server started running. You can click here to verify or copy this. I'll type Ctrl+C, Ctrl+V, and press Enter. So you can see the Laravel server started. So guys, in this video we saw how we can easily download and we can install Laravel and create our first demo app. After that, we also ran the server. Thank you for watching the video.