Introduction & Prerequisites
Hello everyone, welcome to Deepine. In this video, I'm going to teach you how to install Laravel 12 on Window 11.
Okay, first of all, let's open your web browser and then search for Laravel and then go to laravel.com which is official website. Go to documentation and then go to installation. Scroll down and over here, install PHP and Laravel installer. So you need to have PHP, Composer, the Laravel installer, and NodeJS on your computer. Okay, let's install PHP first.
Installing XAMPP for PHP and MySQL
In order to run PHP on window 11 easily, I highly recommend you install XAMPP. It is software package that come with PHP and MySQL as a database, MariaDB I mean, and Apache server. Okay, you can click download over here and then you can click on this one which is PHP version 8.2.12. Try to go with the latest version of PHP. Then XAMPP will be automatically downloaded over here. You can close this one and wait until the downloads is done and then we are going to install XAMPP together.
Okay. After the download is done, just go to the folder and then double click on the files and click yes to authorize the installation. Over here just click okay and then just click next and next. And we are going to leave the default folder at C drive and xampp folder. Just click next. English and then next. If the Apache pop up, just click allow to run Apache. Okay. And then just click on finish.
Verifying XAMPP and Creating a Test Project
The XAMPP software will automatically open. You can start Apache which is PHP server over here. And you can start my SQL as well. And if it asks you do you want to allow public or private network to access this app. Just click on allow.
And then you can open admin over here. It will show the web page localhost and dashboard. And if you click on admin over here, it will redirect you to localhost phpMyAdmin which is phpMyAdmin for Maria DB. You can handle or manage your database over here. For example, you can create a new database over here. Okay, you can stop and stop over here. Every time you open your computer and you want to use the software, you have to open XAMPP again. Just type XAMPP and control panel over here. Just click on it and you can start Apache and my SQL over here.
Okay. And if you go to uh drive C over here and go to XAMPP, you will see the XAMPP folder which is have a lot of files over here. And if you go to htdocs over here, you can put your website over here. You can put PHP files over here. For example, if you want to create a new website, you just create a new folder and new web name is whatever you want and go here and just put something inside here. Let's me open this with Visual Studio Code. And then let's me create a new files over here. For example, index.php. And if I type PHP over here tag and then I echo out hello PHP. Okay. And I save. If you go to web browser and you type localhost and then type new web and index.php. Let me check again. Okay. Hit enter. It will show hello PHP over here. You've successfully installed PHP on your computer.
Installing Composer
All right. The next software that we need is Composer. Okay, we want to install Composer. Let's type Composer and let's go to composer.org over here. Let's click on download. And you can just download composer-setup.exe over here. Okay. And go to the folder. Sometime if you cannot install perpetrator of Laravel, you need to uninstall composer and reinstall the new composer version. Okay, just double click on the files and install for all user and then click on yes and then click next. It's going to ask you the current path of the PHP. Okay. And then just click on add this PHP to your path. Just click next and then next and install and next and click on finish.
Okay, let's type cmd and run composer command over here. You will see composer command over here and the composer version that I've installed is 2.8.6.
Installing Node.js
Okay, the next software that we have to install is node or bunt. In this case, I will go with NodeJS.org and then download the files. And if you have this NodeJS on your computer, sometime you have to check the version of NodeJS or composer to make sure that it can support the latest version of Laravel. Okay.
Double click on the files again and then just click next and then accept agreement and next and next next and install and click on yes and click on finish. You can check the version of NodeJS by going to command prompt again and then type node -v enter. It will show you the current NodeJS that's running on your computer which is version 22.14.0.
Attempting to Install the Laravel Installer
Okay, we have installed NodeJS on composer. The next step we are going to install Laravel. In order to install Laravel, you need to run this command first. This command will download Laravel and put on your computer by using composer. Let's copy this command. For example, if I go to this path C drive XAMPP htdocs and then go to htdocs over here and I can open terminal over here. Try to use command prompt. Go to CD and C drive and then go to XAMPP and then go to HT docs. Okay, we are in this folder. Paste the command over here. Actually, you can run this command everywhere, but I just want to run it on this path because I'm going to install Laravel inside this folder. And if you see this error, I will teach you how to solve it. Right now I don't think that we successfully install Laravel installer on our computer because we have seen many many failures over here.
Troubleshooting the PHP Zip Extension Error
It's about zip extension. So it's tell us to solve it in PHP.ini. So let's go to let's go to desk files. Okay, let's go to XAMPP folder over here and then go to PHP folder and then scroll down to see PHP.ini which is this file. Let's right click and then let's go to more option and property. You will see this one is ini is configuration setting. Okay, you can open these files with visual studio code or notepath. Okay, let's open with notepad. Notepad. Press Ctrl F and then search for zip and then click on down button over here. You will see extension equal zip. You can remove the semicolon over here. Okay. And save the files and then you have to go back to XAMPP and stop the files and stop my SQL and restart it again.
Okay. Then let's go back to command prompt and then let's try to remove the Laravel installer first because we failed to install it. So over here this command composer global require change from require to remove. Okay. And then we are going to install it again by using require command composer global require laravel/installer. Hit enter. You will see we has no error with extraction over here.
Creating a New Laravel 12 Project
Okay, we are done installing the Laravel installer. The next thing we are going to do is to create an application. We can use this command laravel new example-app. Okay. laravel new then the name of the application, example-app. You can name is whatever you want. Hit enter.
It's going to ask you which starter kit would you like to install. You can pick none. Okay. And then it's going to ask you the past, you can choose zero. Later starter kits come with multiple choice, for example react, view, and Alpine. You can choose whatever you want, you know, it's depend on your project. Okay, then you can pick database. We have MariaDB over here. You can choose MariaDB but I'm going with SQLite and it will ask you do you want to run npm install? You can type yes so it will install all JavaScript packages on this project.
Running and Testing the Laravel Application
Okay, the next step you just cd into the application. I mean go to the application folder and then you just run composer rundev or you can open this with visual studio code and then go to terminal, new terminal, and over here I will choose command prompt instead of powershell and then I can run this command composer rundev.
composer rundev. This command will run npm run dev and php artisan serve at the same time and run queue command as well. See your application is running right now. It's running on this IP address and port number which is port 8000 on local host. Here is your application. We've successfully installed Laravel on our computer. For example, if I want to change something over here, I can go to resources and then view and welcome page over here. I can remove everything over here to show if we successfully install Laravel. For example, I can put H1 and hello Laravel. Save. You will see hello Laravel.