User Tools

Site Tools


software:xampp:start

Xampp

Xampp is an open source package that provide a PHP development environment.

Download e Installation

Download the last version of Xampp and follow the relative installation instructions.

In order to be able to install future extensions, like Xdebug, it's necessary to choose to install also the XAMPP Developer Files:

Figure 1: Select to install XAMPP Developer Files to be able to install future PHP modules.

Create a virtul host

A virtual host allows to create more than one PHP development environment on the same machine. Each of them will have a different name and will be associated to a different work directory.

In /opt/lampp/etc/httpd.conf add the possibility to create virtual hosts (remove the #):

# Virtual hosts
Include etc/extra/httpd-vhosts.conf

In /opt/lampp/etc/extra/httpd-vhosts.conf, at the end, add the new virtual hosts (change <user>):

# main local host
<VirtualHost *:80>
    DocumentRoot "/opt/lampp/htdocs"
    ServerName localhost
    <Directory "/opt/lampp/htdocs">
        Options Indexes FollowSymLinks ExecCGI Includes
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
 
# host for internal wiki
<VirtualHost *:80>
    DocumentRoot "/home/<user>/dokuwiki/"
    ServerName <user>.wiki
    <Directory "/home/<user>/dokuwiki/">
        Options Indexes FollowSymLinks ExecCGI Includes
        AllowOverride All
        Require all granted
    </Directory>
    <LocationMatch "/(data|conf|bin|inc)/">
        Require all denied
        Satisfy All
    </LocationMatch>
</VirtualHost>
 
# host for testing php
<VirtualHost *:80>
    DocumentRoot "/home/<user>/php/"
    ServerName <user>.php
    <Directory "/home/<user>/php/">
        Options Indexes FollowSymLinks ExecCGI Includes
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Then, in /etc/hosts associate the unique IP with the different hosts created:

127.0.0.1 localhost <user>.wiki <user>.php

With this settings, the previous hosts are reachable at the addresses:

(Re)Start/Stop Xampp

Every time a file in /opt/lampp/ is edited, in order to apply the changes, it's necessary to restart Xampp. This can be done via:

Command Line

To start Xampp:

sudo /opt/lampp/xampp start

To restart Xampp:

sudo /opt/lampp/xampp restart

To stop Xampp:

sudo /opt/lampp/xampp stop

To know the status of Xampp

sudo /opt/lampp/xampp status

Xampp's control panel

Create a shortcut in the menu which execute the command:

sudo /opt/lampp/manager-linux-x64.run
software/xampp/start.txt · Last modified: 2020/04/03 09:36 (external edit)