XAMPP is an easy to install Apache distribution containing MariaDB, PHP, and Perl. The setup, according to their own pont of view is just to download and start the installer
In this article, you’ll learn how to install XAMPP easily in Ubuntu.
1. Download a XAMPP distribution for Linux
Go to the official xampp website in the downloads area and choose the latest or the distribution with the versions of PHP that you want.
2. Proceed with the installation
Note : Make sure that file have executable permission
Open a terminal, navigate to the folder where the installer is located and execute it using sudo:
That should start the XAMPP installation setup. Continue with the installation as you usual do.
Once the setup is finished, XAMPP should be available for its usage in your Desktop.
3. Check PHPMyAdmin and Apache Web Server
We need to start the MySQL Database and Apache Web Server services in the XAMPP control panel. Open the XAMPP control panel, navigate to the Manage Servers tab.
- In the Manage Servers tab you’ll find a list of services where the previously mentioned services are located. Select individually the services you want to start (in this case MySQL Database and Apache Web Server) and click on Start in the right panel:
Enter http://localhost/phpmyadmin this url in browser to check that MySQL Database service is running properly.
- Create a php file in the htdocs folder of xampp (usually located in /opt/lampp/htdocs/) with the name test.php with the following code:
Note: in case you’re not able to create files, folders or other things in the directory, execute the following command to grant all rights to the htdocs folder of xampp.
sudo chmod 777 -R /opt/lampp/htdocs/
After the creation of the file, if you navigate to http://localhost/test.php you should get as output “Hello” in the browser.