XAMPP is an easy to install Apache distribution containing MariaDB, PHP, Perl and ProFTPD. It contains: Apache, MariaDB, PHP & PEAR, Perl, ProFTPD, phpMyAdmin, OpenSSL, GD, Freetype2, libjpeg, libpng, gdbm, zlib, expat, Sablotron, libxml, Ming, Webalizer, pdf class, ncurses, mod_perl, FreeTDS, gettext, mcrypt, mhash, eAccelerator, SQLite and IMAP C-Client.
Install theAUR package.
The default configuration should work out of the box. Setting the individual parts of XAMPP can by made by editing following files:
/opt/lampp/etc/httpd.conf— Apache configuration. For example you can change folder with web page's source files.
/opt/lampp/etc/php.ini— PHP configuration.
/opt/lampp/phpmyadmin/config.inc.php— phpMyAdmin configuration.
/opt/lampp/etc/proftpd.conf— ProFTPD configuration.
/opt/lampp/etc/my.cnf— MySQL configuration.
If you would like to set up security of server, just run
# /opt/lampp/xampp security
You will be asked step by step to choose passwords for web page's access, user "pma" for phpMyAdmin, user "root" for MySQL and user "daemon" for ProFTPD.
Use the following commands to control XAMPP:
# /opt/lampp/xampp start,stop,restart
Autostart on boot
In order to start XAMPP at boot, enable
Tips and tricks
Hosting files outside the htdocs directory
The document root (web root) directory is located at
/opt/lampp/htdocs/. All files placed in this directory will be processed by the web server.
To host other files on your system with XAMPP, you can configure an alias with Apache.
- Edit Apache's
/opt/lampp/etc/httpd.confwith your favorite editor.
DocumentRoot, you will see something like:
DocumentRoot "/opt/lampp/htdocs" <Directory "/opt/lampp/htdocs"> ... ... </Directory>
- In the next line after
<Directory "/yourDirectory/"> Options Indexes FollowSymLinks ExecCGI Includes AllowOverride All Require all granted </Directory>
- Next find the
<IfModule alias_module> # # Redirect: Allows you to tell clients about documents that used to # exist in your server's namespace, but do not anymore. The client # will make a new request for the document at its new location. # Example: # Redirect permanent /foo http://www.example.com/bar ... </IfModule>
- And before the
Alias /yourAlias /yourDirectory/
- Next find the
<IfModule unixd_module> ... ... User daemon Group daemon </IfModule>
- And change the
User yourUser Group yourGroup
- Now do not forget to restart Apache:
# /opt/lampp/xampp restart
This will allow you to host files from your home directory (or any other directory) with XAMPP.
In the above example, you can access the files by pointing your web browser to
Debugging and profiling with Xdebug and XAMPP
See https://xdebug.org/find-binary.php for detailed instructions.
You must first download the XAMPP Development Tools from the same download page, https://www.apachefriends.org/en/xampp-linux.html.
Extract this into your XAMPP directory:
# tar xvfz xampp-linux-devel-x.x.x.tar.gz -C /opt
You should be able to successfully run
/opt/lampp/bin/phpize in your xdebug folder.
Local test server security
Apache, MySQL and ProFTPD can be configured so that they only listen to requests from your own computer. For most test systems this is fine and it greatly reduces the risk because the services are not reachable from the Internet.
Before you start XAMPP for the first time find and edit these files:
For Apache edit the files
/opt/lampp/etc/extra/httpd-ssl.conf. Look for lines starting with "Listen" such as
and replace them with
For MySQL open the file
/opt/lampp/etc/my.cnf find the section "[mysqld]" and add this line
For ProFTPD, add the following lines to
/opt/lampp/etc/proftpd.conf under the "DefaultServer" section
DefaultAddress 127.0.0.1 SocketBindTight on
After starting the services, verify the result by going to a command window and start and execute:
$ netstat -a -n
For the entries marked as LISTEN in the last column, look at the Listen column. It should always start with 127.0.0.1 or ::1 but not with 0.0.0.0.
# ./xampp-linux-x64-version-installer.run --mode gtk
If you do not want to use any graphical interface and prefer to install XAMPP directly from the terminal, launch:
# ./xampp-linux-x64-version-installer.run --mode text
For further options, launch as normal user:
$ ./xampp-linux-x64-version-installer.run --help
You can now create a systemd service for XAMPP:
[Unit] Description=XAMPP [Service] ExecStart=/opt/lampp/xampp start ExecStop=/opt/lampp/xampp stop Type=forking [Install] WantedBy=multi-user.target
If you have installed XAMPP manually you will need to remove it manually as well. Be sure to stop all XAMPP services.
# /opt/lampp/xampp stop
All the files needed by XAMPP to be installed are located in the previous
/opt/lampp folder. So, to uninstall XAMPP:
# rm /etc/systemd/system/xampp.service # rm -r /opt/lampp
PhpMyAdmin 403 Access Forbidden
If your http://localhost/phpmyadmin returns "403 Access Forbidden", you need to edit the following settings in
<Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit #Order allow,deny #Allow from all Require all granted </Directory>