Downloading XAMPP
Download the XAMPP installer. You can get it from https://www.apachefriends.org/index.html
Make sure to download the correct version for your system (32-bit or 64-bit).
Before you can install XAMPP, you'll need to change the permissions for the downloaded file so that it can be executed.
But first go to the directory in which you have downloaded XAMPP.
Example: $ cd Downloads
Now, change the permissions, enter the following command and press Enter, entering your password if required:
$ sudo chmod +x xampp-linux-x64-7.1.7-0-installer.run
Run the installer. After changing the permissions, you can run the installer to begin installing XAMPP. Type the following command and press Enter:
$ sudo ./xampp-linux-x64-7.1.7-0-installer.run
Configuring XAMPP
Start the XAMPP service. You can start XAMPP using the Terminal by entering the following command and pressing Enter. You may be prompted for your password.
$ sudo /opt/lampp/lampp start
Open the XAMPP splash page in your web browser. Open your web browser and type in http://localhost/xampp/ in your address bar. If the XAMPP service is running, you'll see the Welcome page. This will help you test that XAMPP is running correctly.
Set XAMPP to start when Linux boots. If you want XAMPP to run whenever the computer is turned on and logged in, you can add a line to your rc.local file:
a) Open the Terminal, type
$ sudo nano /etc/rc.local
and press Enter to open the rc.local file in the editor.
You can replace nano with your preferred editor. Example: gedit
Add: /opt/lampp/lampp start
to the line before exit 0.
Save and close the rc.local file.
You will be asked to set a password for XAMPP, set some MySQL security settings, create a MySQL password, phpMyAdmin password, and FTP password.
Note that this will set your XAMPP username to llamp.
file and remove the " ; " from the beginning of each of the following lines. Restart XAMPP after saving the file:
Before:
;extension="eaccelerator.so"
;eaccelerator.shm_size="16"
;eaccelerator.cache_dir="/opt/lampp/tmp/eaccelerator"
;eaccelerator.enable="1"
;eaccelerator.optimizer="1"
;eaccelerator.check_mtime="1"
;eaccelerator.debug="0"
;eaccelerator.filter=""
;eaccelerator.shm_max="0"
;eaccelerator.shm_ttl="0"
;eaccelerator.shm_prune_period="0"
;eaccelerator.shm_only="0"
;eaccelerator.compress="1"
;eaccelerator.compress_level="9"
After:
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/opt/lampp/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
Voila, it's done! Now you can enjoy coding in PHP and do whatever stuff you like.