Public | Automated Build

Last pushed: 5 months ago
Short Description
XAMPP(MySQL+PHP+PHPMyAdmin) with SSH server.Mount /www, your site URL: http://localhost:[port]/www
Full Description

This image is intended for PHP+MySQL development. For convenience, it also runs SSH server to connect to. Both MySQL and phpmyadmin use default XAMPP password.

Running the image:

This image uses /www directory for your page files, so you need to mount it.

docker run --name myXampp -p 41061:22 -p 41062:80 -d -v ~/my_web_pages:/www tomsik68/xampp

The command above will expose the SSH server on port 41061 and HTTP server on port 41062.
Feel free to use your own name for the container...

To connect to your web page, visit this URL: http://localhost:41062/www
And to open up the XAMPP interface: http://localhost:41062/

additional How tos

ssh connection

default SSH password is 'root'.

ssh root@localhost -p 41061

get a shell terminal inside your container

docker exec -ti myXampp bash

use binaries provided by XAMPP

Inside docker container:

export PATH=/opt/lampp/bin:$PATH

You can then use mysql and friends installed in /opt/lampp/bin in your current bash session. If you want this to persist, you need to add it to your user or system-wide .bashrc (inside container).

Use your own configuration

In your home directory, create a my_apache_conf directory in which you place any number of apache configuration directive files. As soon as they end up with the .conf extension, they will be used by the image.

docker run --name myXampp -p 41061:22 -p 41062:80 -d -v ~/my_web_pages:/www  -v ~/my_apache_conf:/opt/lampp/apache2/conf.d tomsik68/xampp

Restart the server

Once you have modified configuration for example

docker exec myXampp /opt/lampp/lampp restart

Please report any issues in issues section on github: https://github.com/tomsik68/docker-xampp/issues where we can track them conveniently. Thanks :)

Docker Pull Command
Owner
tomsik68
Source Repository

Comments (7)
ginppian
18 days ago

In my case i use filezilla and i used:

sudo chmod 777 my_web_pages/

ginppian
a month ago

docker exec -ti myXampp bash
cd www
touch db.php
nano db.php

<?php
$servername = "localhost";
$username = "root";
$password = "";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>

IN NAVIGATOR:
url:41062/www/db.php

manuelsoberanojc
2 months ago

Excellent, you saved a lot of work, thank you

probeab
5 months ago

Hi, Thank for your image helpful.
Could add mutt and crontab command in next time release?
Thank you.

artandor
6 months ago

Hello !

I'm trying to release a symfony project on it but it's unable to find PDO, maybe it would be a great improve to add it on next releases. I don't know how to do it tho and i'll investigate, if you guys got any help for me, it's nice :)

3rawkz
7 months ago

@pmorais though a year ago... In the off chance some on looker finds themselves with the same question...

  1. Linux/OSx: Terminal: locate www or in file browser search all for... www
  2. Windows: File Explorer search... www
    If you happen to not have one then.... www.google.com .. search setting up local development; lamp stack; xamp....

yeahhh

pmorais
2 years ago

please can you tell me how do i access the www directory thank you.