How to Install XAMPP on Windows & How to Install Composer

 

How to Install XAMPP on Windows

In order to build Laravel applications, we need to install PHP and MySQL on our machine. The easiest way to install PHP on Windows is through XAMPP. It is available on all three desktop operating systems—Windows, Linux, and Mac. However, on Mac it's best to use MAMP, which is compatible with the new M1 and M2 chips.

Now let's take a look at how to install XAMMP on Windows. 

Go to https://www.apachefriends.org/download.html and download the installer for your operating system. Select the latest version of PHP, i.e. the one at the bottom of the list.

Install wizard xammp pic 1

1. Install Wizard

Double-click the installer, and then follow the prompts. 

2. Installer Settings

You won’t need to change any of the installation settings—the defaults are all good as is.

xammp select components pic 2
xammp location pic 3

3. Installation Folder

Of particular note, you should leave the installation drive as the C:\ drive on Windows in order for things to function correctly.

You may also need to grant approval for XAMPP’s Apache installation to have network access through Windows Defender or any other firewall you might be running.

4. Control Panel

Continue following the prompts. When the installation is complete, leave the option checked that says Do you want to run the Control Panel now? Then close the installer, and you’ll see the XAMPP Control Panel appear.

If you missed the chance to leave that box checked, just run XAMPP from your list of installed software to start the Control Panel.

xammp control panel pic 4

How to Install Composer

Composer is a package management tool in PHP. Its main purpose is to make it easier to manage the libraries in your project by installing and updating them automatically. Here, some people might mistake it for a package manager in the same sense as Yum or Apt, but this is not quite how it works.

Once you have PHP installed on your system, it's easy to install Composer. First, download it from the Composer website.

Composer setup and installation options

1. Install Composer 

Click on the downloaded Composer-Setup.exe file (for Windows) or the equivalent for your operating system. Run the installer, and it will install the latest Composer version.

2. Adjust the System Path 

Add the PHP executable to your system path using the installer. 

Composer PHP Path
Composer - Choose Proxy

3. Proxy Server Setup

If you don't have a proxy server, just click Next.

4. Install

Composer is now ready to install, and the setup wizard will download files onto your machine.

Composer Ready to Install
Test Composer on Command Prompt

5. Test 

You want to be sure that Composer will run without hitches. 

Open the command prompt or terminal, and run the command composer --version. You should see the current Composer version printed to the terminal.

How to Install Laravel

1. Open the Terminal

Now that you have installed PHP and Composer, creating a Laravel project is straightforward. Open your terminal.

Open Command Prompt / Terminal

2. Create a Laravel Project

Run the command below to create a brand new project inside a folder named my-app (or any project name you wish):

1
composer create-project laravel/laravel my-app

This will download all the necessary Laravel files for this project.

3. Start the Development Server

After the application has been created, cd into my-app and start your development server using the following commands:

1
cd my-app
2
php artisan serve

4.  Browse to Your New Laravel App

We are done setting up the environment. You should be able to access your Laravel development server at https://localhost:8000.

Localhost:8000

Comments

Popular posts from this blog

Difference join between (+) and (-) notation

Oracle Data Guard Startup & Shutdown Steps

Setup Oracle Database in Laravel