Install xampp on Linux Mint

Notes that I made for myself years ago to install xampp on Linux Mint

Warning: These are old notes that I am not maintaining or updating

xampp

<IfModule unixd_module> 
  User steve
  Group steve 
</IfModule> 
#!/bin/sh
### BEGIN INIT INFO
# Provides:          xampp
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start xampp at boot time
# Description:       Enable xampp provided by daemon.
### END INIT INFO

case "$1" in
start)
  /opt/lampp/lampp startapache && /opt/lampp/lampp startmysql
  ;;
stop)
  /opt/lampp/lampp stopapache && /opt/lampp/lampp stopmysql
  ;;
restart)
  $0 stop && $0 start
  ;;
status)
  /opt/lampp/lampp status
  ;;
*)
  # parameters are needed, echo usage options and return error code 1
  echo "Usage: {start|stop|restart|status}"
  exit 1;
  ;;
esac

# exit with the last code
exit $?

Install xdebug

1. `sudo apt-get install php-xdebug`
2. ~~Install from software manager~~

Configure xDebug

sudo vim /opt/lampp/etc/php.ini

Add the following lines to the end of php.ini

zend_extension="/opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
;xdebug.remote_enable=On
;xdebug.remote_host=”localhost”
;xdebug.remote_port=9000
;xdebug.remote_handler=”dbgp”xdebug.var_display_max_data=-1
xdebug.var_display_max_children=-1
xdebug.var_display_max_depth=3
sudo /opt/lampp/lampp restart

Virtual Hosts

I don’t remember exactly how I set up wildcard virtual host domains, but I can review other notes and fill this out more if anyone is interested.

sudo vim /opt/lampp/apache2/conf/httpd.conf

Add this for wildcard sub domains pointing to directory in htdocs, add to the bottom of the conf file

<VirtualHost *:80>
    VirtualDocumentRoot /opt/lampp/htdocs/%-2+/
</VirtualHost>

Configure mail

sudo apt-get install mailutils
sudo apt-get install sendmail

Command Line php

sudo vim /etc/environment

Add the path (/opt/lampp/bin) to php to the $PATH variable at the beginning so it loads before Linux php

source /etc/environment

Check that php cli is loading the correct ini and running the correct version

php --ini
php -v

phpunit

  1. $ sudo apt-get install phpunit
  2. Install from software manager
  3. set up autoload and xml file

PDO

  1. Uncomment the PDO MySQL extension sudo vim /opt/lampp/etc/php.ini
  2. Add the extension to the cli version of php.ini

Find the ini

php -i | grep 'php.ini'
vim /etc/php5/cli/php.ini

troubleshooting

Uninstall xampp

sudo chmod +x /opt/lampp/uninstall
sudo /opt/lampp/uninstall
sudo rm -rf /opt/lampp