"Setting Up Laravel on Windows with XAMPP and Composer: Best Practices?"

28 Views Asked by At

I'm working on a web project and have decided to use the Laravel framework due to its robust features and scalability. I've seen tutorials suggesting that Laravel can be installed using XAMPP and Composer on a Windows environment. Before diving in, I want to ensure that this approach is feasible and aligns with best practices.

From my understanding, XAMPP provides a local server environment that can host PHP applications, and Composer is used for managing PHP dependencies, which seems essential for Laravel projects.

What I've Done:

Watched several YouTube tutorials to grasp the installation process. Attempted to follow the steps provided, focusing on setting up XAMPP and Composer on my Windows machine. My Question: Is using XAMPP alongside Composer a recommended method for installing and running Laravel on Windows? If so, could you guide me through the process or direct me to comprehensive resources or videos that detail the setup step by step?

Thank you in advance for your assistance.

1

There are 1 best solutions below

4
Eyad Bereh On

Well, as you've already seen from your search, XAMPP provides a local development environment that's able to host PHP applications during development stages, and it also ships with a built-in MariaDB server and a built-in Apache web server, and that's all about it.

Composer on the other hand is a tool that allows you to manage the dependencies for your PHP projects, and that's all about it.

Using these two software alongside each other is perfectly fine, I've done that for many years when I used to develop on Windows and had no issues at all.

Since you're using Laravel, I would suggest the following:

  • When you install XAMPP, it automatically installs a MariaDB server for you alongside a phpMyAdmin version, so I suggest you use XAMPP only for this purpose.
  • Laravel ships with a built-in web server (artisan) that's intended for development purposes, so I suggest you use that instead of the built-in Apache server that ships with XAMPP. You don't need to move your application inside the htdocs directory.

Of course, this is just the way I've been doing things for years, and there's no correct answer here really.