In this post we will see How to install XAMPP in Ubuntu 16.04.
Step 1 :
Open the link https://www.apachefriends.org/download.html in your favorite browser and download the latest version of LAMPP software that you want for Ubuntu Linux.
STEP 2. Open your Terminal and Change directory to the Downloads folder (by default it downloads into the Downloads folder)
$ cd Downloads
STEP 3. Change the execution rights if the installation file, So we can run it as executable file. Execute this command
sudo chmod +x xampp-linux-x64-7.2.3-0-installer.run
Note : The version of XAMPP you’ll download might be different, so change the version in this command accordingly.
For above command to run you have to provide your system’s password
STEP4 .
Run the installer, but don’t close the Terminal.
$ sudo ./xampp-linux-x64-7.2.3-0-installer.run
A installation set up dialog box will open. In the dialog box, click next(for each step) and move through the process of installation. Once XAMPP is installed, click finish.
Click Next !
Click Next !
Click Next !
Click Next !
Click Finish!
This will launch the Xampp control panel like shown below. Here Click “Manage servers“.
Now start all three services by pressing start all button.
You can also use the commands below to run the Xampp control panel.
- If you use a 64-bit system:
sudo /opt/lampp/manager-linux-x64.run
Once all Apache server is running . You can use the URL http://localhost/dashboard to open the Dashboard.
You can also verify if phpmyadmin is running by opening the URL http://localhost/phpmyadmin.
Now Lets try to run some PHP code using our Apache server. For that you need to create a php file in the htdocs directory of Xampp. htdocs is generally located in /opt/lampp/htdocs/
. Create a php file with the name myphp.php with the following code:
<?php echo "Hello world!"; ?>
Now we will change the permission of the files in htdocs using the following command
sudo chmod +x -R /opt/lampp/htdocs/
Now open the URL http://localhost/myphp.php. You will see Hello World printed on your browser.
Thats it.
Some More helpful commands
- To set a password, type
./lampp security
Press
y + Enter.
Then enter a new password and re-enter this password again to confirm. - Start XAMPP
./xampp start
Type
exit
(Enter) to exit the SuperUser - To start XAMPP, execute this command
sudo /opt/lampp/lampp start
- To stop XAMPP, execute this command
sudo /opt/lampp/lampp stop
Video Instructions
Thanks! Nice article. It helps me to setup XAMPP on Zorin OS 12
Would be nice to see how to make it show with the rest of the apps