In this guide, we want to teach you How To Install XAMPP on Ubuntu 22.04.
XAMPP is one of the widely used cross-platform web servers, which helps developers to create and test their programs on a local webserver. It was developed by Apache Friends, and its native source code can be revised or modified by the audience.
It consists of Apache HTTP Server, MariaDB, and an interpreter for different programming languages like PHP and Perl. Also, it is available in 11 languages and supported by different platforms such as the IA-32 package of Windows & x64 package of macOS and Linux.
How To Install XAMPP on Ubuntu 22.04
To install XAMPP, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide the Initial Server Setup with Ubuntu 22.04.
Now follow the steps below to complete this guide.
Installing XAMPP on Ubuntu 22.04 from CLI
First, you need to update your local package index with the following command:
sudo apt update
Then, you need to visit the Apache Friends Downloads page and copy the link address of XAMPP for Linux. And Use the wget command to download it, here we download it for PHP 8.1.
Now set the correct permissions for your downloaded file with the following command:
sudo chmod 755 xampp-linux-x64-8.1.6-0-installer.run
Next, run your XAMPP installer script on Ubuntu 22.04 with the following command:
You will be asked some questions, enter y to continue your installation.
When your installation is completed, you will get the following output:
Output Please wait while Setup installs XAMPP on your computer. Installing 0% ______________ 50% ______________ 100% ######################################### ---------------------------------------------------------------------------- Setup has finished installing XAMPP on your computer.
At this point, you need to allow everyone to access the XAMPP server on Ubuntu 22.04.
Configure and Start XAMPP on Ubuntu 22.04
/opt/lamp/etc/extra/httpd-xampp.conf file and add a line ” Require all granted” and comment out or delete the line “Require local“.
sudo vi /opt/lampp/etc/extra/httpd-xampp.conf
<Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit Require all granted ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory>
When you are done, save and close the file.
At this point, restart your XAMPP service on Ubuntu 22.04 with the command below:
Output Restarting XAMPP for Linux 8.1.6-0... XAMPP: Stopping Apache...ok. XAMPP: Stopping MySQL...ok. XAMPP: Stopping ProFTPD...not running. XAMPP: Starting Apache...ok. XAMPP: Starting MySQL...ok. XAMPP: Starting ProFTPD...ok.
How To Resolve “unable to determine the IP address of hostname”
Important Note: If you are facing the following error while restarting your XAMPP service:
Restarting XAMPP for Linux 8.1.6-0... XAMPP: Stopping Apache...ok. XAMPP: Stopping MySQL...not running. XAMPP: Stopping ProFTPD...not running. XAMPP: Starting Apache...ok. XAMPP: Starting MySQL...ok. XAMPP: Starting ProFTPD...fail. Contents of "/opt/lampp/var/proftpd/start.err": 2022-06-27 13:07:19,002 ... proftpd: warning: unable to determine IP address of '...' 2022-06-27 13:07:19,002 ... proftpd: error: no valid servers configured 2022-06-27 13:07:19,002 ... proftpd: fatal: error processing configuration file '/opt/lampp/etc/proftpd.conf'
You need to resolve the hostname in this situation. Open the
/etc/hosts file and it has an entry for simple localhost. It should have something like the below example:
127.0.0.1 localhost.localdomain localhost 127.0.1.1 your-system-name
You need to edit the file and change it to:
127.0.0.1 localhost 127.0.1.1 your-Hostname
When you are done, save and close the file.
Then, restart your XAMPP service again and it will start correctly.
Access XAMPP Web Interface
At this point, you can access your XAMPP on Ubuntu 22.04 through the web interface. Type your server’s IP address in your web browser:
You will see your XAMPP welcome page:
To see your PHP information, you can click on the PHPInfo at the top of the screen.
Also, to access the phpMyAdmin page you can click on the phpMyAdmin at the top of the screen.
Or you can type the URL with /phpmyadmin in the address bar:
At this point, you learn to Install XAMPP on Ubuntu 22.04.
Hope you enjoy it.
You may be interested in these articles:
Install and Configure Laravel on Ubuntu 22.04