XAMPP is a popular package that combines Apache, MariaDB, and PHP in one place. While Linux has its own repositories, XAMPP is an excellent choice for developers who need an isolated and quickly configurable environment.
1. Download and Preparation
- Visit the official Apache Friends website and download the latest version for Linux.
- Open the terminal and navigate to the folder with the downloaded file (e.g., Downloads):
cd ~/Downloads - Grant execution permissions to the file:
sudo chmod +x xampp-linux-x64-installer.run
2. Installation and Launch
Run the installer with the following command:
sudo ./xampp-linux-x64-installer.run
Follow the wizard, which will install XAMPP into the /opt/lampp directory. If the server does not start automatically, use the command:
sudo /opt/lampp/lampp start
Troubleshooting (net-tools)
If you encounter an error regarding the netstat command, you need to install additional network utilities:
sudo apt update && sudo apt install net-tools
sudo /opt/lampp/lampp restart
3. Management Commands
- Start:
sudo /opt/lampp/lampp start - Stop:
sudo /opt/lampp/lampp stop - Restart:
sudo /opt/lampp/lampp restart
Connecting with PHPStorm
To make PHPStorm recognize the XAMPP PHP interpreter, follow these steps:
- Open File > Settings (Ctrl+Alt+S).
- Navigate to PHP and click the three dots (...) next to the CLI Interpreter.
- Click +, select From Local... and enter the path:
/opt/lampp/bin/php - Confirm with OK and click Apply.