Laravel 6 Tutorial for Beginners #2 – Installing Laravel

Welcome back to our Laravel 6 tutorial series for beginners. In this second installment, we’ll walk through the process of installing Laravel, the robust PHP framework for web artisans. Before diving into Laravel, however, it’s crucial to have PHP and MySQL running on your local development environment. One of the easiest ways to set this up is by using XAMPP, which provides an all-in-one package. Let’s begin by laying down the foundation with XAMPP, and then move forward to installing Laravel itself.

xampp-logo

To get started, you need to install XAMPP. XAMPP is a free and open-source cross-platform web server solution package that contains PHP, MySQL, and Apache. Go to the official XAMPP website and download the version compatible with your operating system.

Once downloaded, follow these steps:

  1. Launch the installer and follow the prompts.
  2. Select the components you want to install. For Laravel, ensure PHP and MySQL are checked.
  3. Choose the installation directory (by default, it is C:\xampp on Windows).
  4. Initiate the installation and wait until it completes.
  5. After installation, start the XAMPP Control Panel and activate Apache and MySQL.

With XAMPP installed, you now have a local server environment ready to host your Laravel applications.

Laravel utilizes Composer for managing its dependencies, so before we install Laravel, we need Composer installed on our system. To install Composer:

  1. Visit the Composer website and download the installer for your operating system.
  2. Run the Composer installer and ensure it is set up to use the PHP executable from your XAMPP installation.
  3. Once Composer is installed, you will be able to use it from the command line. Verify the installation by running composer in your terminal or command prompt.

With our environment ready, it’s time to install Laravel. Open your terminal or command prompt and follow these steps:

  1. Move to the directory where you want to install your Laravel project. It could be within the ‘htdocs’ folder in your XAMPP installation path if you wish to access it via localhost in the browser.
  2. Run the following command to create a new Laravel project:
    composer create-project --prefer-dist laravel/laravel blog
    
    Here, blog is the name of your project. You can replace it with whatever you choose.
  3. After the installation is complete, you can start the Laravel development server by navigating to your project directory and running:
    php artisan serve
    
  4. You will see a message stating that the Laravel development server has started. Visit the URL provided (usually http://localhost:8000) in your web browser to see your new Laravel application.

Congratulations! You’ve successfully set up your development environment with XAMPP and installed Laravel. You are now ready to begin developing amazing web applications with one of the most popular PHP frameworks available. In the next part of our series, we will dive into Laravel’s architecture and explore basic routing and controllers. Stay tuned!

Leave a Reply

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

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.