How to Install Laravel on Windows 10 or 11?

Introduction:

Laravel is a popular PHP framework that enables developers to build web applications quickly and efficiently. Whether you’re a seasoned developer or just starting with PHP, installing Laravel on Windows 10 or 11 is a straightforward process. In this step-by-step guide, we’ll walk you through the installation process so you can begin creating powerful web applications with Laravel.

Before you begin:

Ensure that you have the following prerequisites installed on your Windows machine:

  1. PHP (7.3.0 or higher)
  2. Composer (latest version)
  3. Git (latest version)
  4. A development environment like XAMPP or WampServer (optional, but recommended)

Step 1: Install PHP

If you don’t have PHP installed on your Windows machine, you can download the latest version of PHP from the official website (https://windows.php.net/download/). Be sure to choose the right version (x64 or x86) based on your system architecture. After downloading, follow the installation wizard to install PHP on your machine.

Step 2: Install Composer

Composer is a package manager for PHP that Laravel heavily relies on. To install Composer, follow these steps:

Download the Composer Windows Installer from https://getcomposer.org/Composer-Setup.exe.
Run the installer and follow the on-screen instructions. When asked to select PHP, make sure to point it to the PHP executable you installed in Step 1.

Step 3: Install Git (Optional)

Git is useful for version control and pulling Laravel updates. If you don’t have Git installed, you can download it from the official website (https://git-scm.com/downloads) and follow the installation instructions.

Step 4: Set Up Laravel

Now that you have PHP, Composer, and Git (optional) installed, it’s time to set up Laravel.

  1. Open your preferred terminal or command prompt on Windows (e.g., Command Prompt or PowerShell).
  2. Navigate to the directory where you want to install Laravel. For example, if you want to install it in C:\xampp\htdocs, use the cd command like this:
    cd C:\xampp\htdocs
  3. Use Composer to create a new Laravel project. Run the following command:
    composer create-project laravel/laravel my-project
    Replace my-project with the name of your project; this will create a new Laravel project in the specified directory.

Step 5: Start Laravel Development Server

  1. Navigate to your Laravel project directory using the command prompt:
    cd my-project
  2. Start the Laravel development server by running the following command:
    php artisan serve
  3. The development server will be accessible at http://localhost:8000. Open your web browser and visit this URL to see the Laravel welcome page.

Congratulations! You’ve successfully installed Laravel on your Windows 10 or 11 machine. You are now ready to start building your web applications using the powerful Laravel framework.

Conclusion:
Installing Laravel on Windows 10 or 11 is a simple process that requires PHP, Composer, and optionally, Git. By following the steps outlined in this guide, you can quickly set up your development environment and start creating amazing web applications with Laravel. Happy coding!

Leave a Comment

Your email address will not be published. Required fields are marked *

*
*