1. Install XAMPP
XAMPP is a free and open-source web server solution stack that includes PHP, MySQL, and Apache. To install XAMPP on Windows, follow these steps:
Visit the XAMPP download page and download the appropriate installer for your Windows version.
Run the installer and follow the on-screen instructions. During the installation process, you can choose which components to install. Make sure to select PHP and MySQL.
Once installed, launch the XAMPP Control Panel and start the Apache and MySQL services.
2. Install Composer
Composer is a dependency management tool for PHP that is required to install Laravel. To install Composer on Windows, follow these steps:
Visit the Composer download page and download the Composer-Setup.exe file.
Run the Composer-Setup.exe file and follow the on-screen instructions.
You’ll also be prompted to select the install mode. Be sure to pick Install for all users (recommended).
Make sure to select the correct PHP executable during the installation process (usually located in the XAMPP installation folder under xampp/php/php.exe).
Click Next to move through the on-screen instructions then click Install.
3. Verify Composer Installation
To verify that Composer was installed correctly, open the Command Prompt and run the following command:
composer --version
If the installation was successful, you should see the Composer version displayed.
4. Install Laravel Using Composer
You can use Composer, which is now installed, to install Laravel globally on your system. To do so, open the Command Prompt and run the given command:
composer create-project laravel/laravel app-name
This will automatically download all the relevant Laravel files to create a new project.
5. Verify Laravel Installation
To verify that Laravel was installed correctly, open the Command Prompt and run the following command:
laravel --version
After a successful installation, you will be able to see the Laravel version.
6. Start The Server
With your new app project created, you will then need to start a server. To do this, type in the following:
cd app-name
php artisan serve
7. Run The Project In Your Browser
With the server started you should then be able to access your app project via your web browser. To do this, open your browser and go to the following: https://localhost:8000