How to install Laravel on Windows 11 with WAMP easily
Since I was a child I’ve always preferred to use Linux, however lately I’ve decided to give Windows 11 a chance. How could I develop a Laravel app on Windows 11?
I initially tried to use Docker, however the WSL virtualization system slows down containers a lot, and for large applications or projects it becomes complicated and frustrating.
Consequently I preferred to follow a different approach, in this article I will explain how to use Laravel with Windows by installing Wamp, so that you can always have control over the versioning of your tools like PHP or your database.
Step 1: install WAMP
WAMP indicates a Windows stack used to turn the computer into a local server that hosts web pages. This is a variant of the LAMP stack for Windows operating systems. The letters WAMP refer to the Windows operating system, the Apache server (Apache HTTP Server) used to run the web server on Windows, the MySQL DBMS and the PHP language, which together allow you to build a dynamic web page. Occasionally, MariaDB may be used instead of MySQL, and Perl or Python instead of PHP — the acronym still holds true.
Go to the wamp server site and download the executable, just follow the wizard, then run the app.
Step 2: Install Packages
When WAMP is ready, go to the status navigation item on the left side, and install the packages you prefer by clicking on the right upper green button.
You may need to install different versions of the proposed packages. In that case just click on the right side upper button to enable deprecated packages.
In this case we are going to use the latest stable version of PHP, MySql and Apache (do not download the Laravel module, we’ll do it in a minute.
Step 3: create a site
Click on the site section of the sidebar, then create a site using this configuration (remember to create a folder where you prefer, this one is going to contain the project).
Step 4: Install Laravel and set the correct root directory
Go to the package installer page and download Laravel on the site you created, you will need to change the root directory of the site, because Laravel uses the /public directory for the index.php file, you’ll need to click on the site configuration button, then change the path.
You should be able to see the Laravel welcome page if you click on the site link.
Step 5: install Composer and Node
Download and launch the composer installer executable that you can find at https://getcomposer.org/download/. Composer will require a PHP path, use the php version you prefer from the Wamp bin filder, in my chase the folder was: C:\Wamp.NET\bin.
Next one is Node, in order to get it, download it from https://nodejs.org/it/download/, go through the wizard and you are ready to go! Restart the pc, just to be sure.
After the restart of your machine you should be able to see the version of composer and node by typing on a command line:
node --version
composer --version
Step 6: Try your installation
If everything went well, you should be able to install a composer module and compile assets with npm, try to install breeze and compile assets, for example by following this part of the documentation: https://laravel.com/docs/9.x/starter-kits#laravel-breeze-installation.