XAMPP by bitnami is a complete stack of Apache, MariaDB(MySql), PHP and Perl. It is a completely free software and widely used on all platforms for web development by developers. Although we have choice to install Apache, MySql and PHP separately on Linux platform easily but many developers choose to install XAMPP for Linux. This article will let you show how to install XAMPP and Composer on Linux – Debian.
XAMPP – Download
Download the latest version of XAMPP from its official website https://www.apachefriends.org by clicking on XAMPP for Linux on home page.
XAMPP – Installation
Open the terminal and navigate to the containing folder using cd
command. Possibly your downloaded file will be in Downloads folder.
cd Downloads
Change the permission of file using chmod
command. Replace your downloaded filename with xampp-linux-*-installer.run
in below command.
sudo chmod 755 xampp-linux-*-installer.run
Execute the file
sudo ./xampp-linux-*-installer.run
You are all set to run XAMPP on your Linux machine.
To start, stop, restart XAMPP run the following commands.
sudo /opt/lampp/lampp start
sudo /opt/lampp/lampp stop
sudo /opt/lampp/lampp restart
Setting up Environment Variables
To install PHP technologies like composer, laravel, codeigniter and many others we need to set-up PHP path as an environment variable. Below are the steps to do this.
Open file /etc/environment
as root using an Gedit –
sudo gedit /etc/environment
Add the following line at the end of file and then save and exit –
:/opt/lampp/bin/php
Now we need to create a symbolic link –
sudo ln -s /opt/lampp/bin/php /usr/local/bin/php
Composer – Installation
First we need to download composer using curl
. If curl
is not installed on your system, first install it using following command –
sudo apt-get install curl
then download composer
curl -sS https://getcomposer.org/installer | php
Now move composer to /usr/local/bin/composer
folder using following command –
sudo mv composer.phar /usr/local/bin/composer
Done! All set.