Laravel is one of the best full stack frameworks used to develop modern web application simply and securely. Day by day PHP developers are absorbing Laravel. So, its popularity is increasing rapidly. Laravel provides all the necessary toolkits which are required to develop a modern web application.
Laravel has a lot of packages those help to start and build modern web application simply, quickly and securely. Besides these Laravel packages, Laravel livewire and inertia have increased Laravel’s power and break any limitation.
Although Laravel is simple to implement, a newbie PHP developer can feel difficulty to start Laravel first time if he/she does not know proper guideline. So, in this tutorial I am going to show how to install Laravel 9 on Windows 10/11 from very beginning so that a newbie developer can start this awesome framework without any hassle.
Laravel Installation Requirements
As Laravel is a PHP framework, PHP is the first requirement. PHP can download for windows from PHP website and can be used. But the best way to have PHP in your Windows system is to download and install XAMPP package. XAMPP provides Web Server, Database Server and PHP which are required to develop a PHP based web application.
So, download the latest XAMPP package (PHP version must be 8 because Laravel 9 cannot be installed without PHP 8) and install it in your Windows Operating System. Installing XAMPP package is not so difficult. It is as simple as installing other windows software.
Note: If you get PHP warning like the following line,
PHP Warning: ‘C:\\Windows\\SYSTEM32\\VCRUNTIME140.dll’ 14.13 is not compatible with this PHP build linked with 14.29 in Unknown on line 0
Go to the Microsoft Visual Studio’s official website. Now, go to the “All Downloads” section below and click “Other Tools, Frameworks, and Redistributables” and then download and install Microsoft Visual C++ Redistributable for Visual Studio 2022.
Composer is another mandatory requirement for Laravel installation. So, go to Composer download page and download composer for windows from there and then install composer in your Windows Operating System. It is also as simple as installing other Windows software.
Node and NPM are also recommended installations for Laravel. So, go Node’s website and download the latest Node installer and then install it in your Windows System. It is also simple installation.
After installing all the required software, open CMD and check their version like the following image.
Installing Laravel Installer
After installing required software, open CMD and run the following composer command to install Laravel installer globally.
:\> composer global require laravel/installer
You can also check the Laravel installer version with the following command.
:\> laravel -V
Creating First Laravel Project
After installing Laravel installer, we are now ready to create first Laravel project with the Laravel installer. To create first Laravel project, go to your desired directory where you want to keep project folder and then open CMD and run the following command.
E:\Laravel Projects> laravel new blog
From the above command you can see I am creating a new project named blog within Laravel Projects folder in E drive.
Now go to blog directory with the following command.
E:\Laravel Projects>cd blog
And start Laravel’s local development server using the Laravel’s Artisan CLI serve command.
E:\Laravel Projects\blog>php artisan serve
Starting Laravel development server: http://127.0.0.1:8000
[Thu Jun 30 16:26:50 2022] PHP 8.0.19 Development Server (http://127.0.0.1:8000) started
Now you will find that local development server has been started on 8000 port and the URL will be shown to access Laravel’s home page.
So, open your favorite web browser and type the provided URL (http://127.0.0.1:8000). If everything is OK, you will find the following Laravel page.
Congratulation! Your Laravel installation is successful. Now it is time to build something awesome with Laravel framework. In the upcoming tutorials, we will learn how to play with Laravel framework to develop your idea with Laravel.
How to install and configure Laravel Framework on Windows Operating System has been discussed in this article. I hope, you will now be able to install Laravel framework without any confusion. However, if you face any confusion, feel free to discuss in comment or contact me from Contact page. I will try my best to stay with you.