XAMPP is Ideal for a Local Dev Environment
XAMPP is a cross-platform solution and distribution of Apache which contains MySQL, Perl, PHP, and Python sectors. It is a conglomeration of LAMP, WAMP, and MAMP that aids in developing PHP web applications, including the phpMyAdmin module.
As an open-source distribution of Apache containing Perl, MariaDB, and PHP, XAMPP is a web server used to pre-test and pre-allocate resources for a project before deployment. While it is a cross-platform server, it is often noted to perform best with Windows.
Installing XAMPP using Windows
The procedure for XAMPP requires some manual routing and copy-pasting. Follow these steps:
- Download: Get the latest Windows version of XAMPP from the Apache Friends website.
- Install: Run the installer to set up XAMPP on your computer.
- Launch: Open the XAMPP Control Panel once installation is complete.
- Start Modules: Click the Start buttons next to the Apache and MySQL modules.
- Access Directory: Click the Explorer button in the Control Panel to open the installation directory.
- Navigate to Root: Go to the htdocs folder, which is the default root directory for XAMPP web servers.
- Create Project: Create a new folder inside htdocs to serve as your project’s root directory.
- Add Files: Copy your project’s PHP files into this new folder.
- View Project: Open a web browser and enter localhost. Click the link for your project folder to access your work.
Installing XAMPP using Mac/OSX
The process is similar to Windows, but involves a .dmg file that must be handled correctly.
- Download: Get the latest OSX/Mac version of XAMPP from the Apache Friends website.
- Install: Open the .dmg (disk image) file and run the installer. Follow the OSX instructions to complete the setup.
- Launch: Open the XAMPP Control Panel.
- Start Modules: Click the Start buttons for both Apache and MySQL.
- Mount Disk: Click the Volumes button in the Control Panel and select Mount next to your XAMPP disk image.
- Access Directory: Click on Explorer in the Control Panel to open the installation directory.
- Navigate to Root: Locate the htdocs folder, the default web root directory.
- Create Project: Create a new folder in htdocs for your PHP project.
- Add Files: Copy your PHP files into that folder.
- View Project: Enter localhost in your web browser and select your project folder.
Why Use XAMPP?
XAMPP is popular because it handles every basic requirement of a development environment needed for PHP web development. It allows beginners and learners to start their PHP journey with relative ease and comfort.