1
votes

I wish to start Xampp when i switch on my laptop having Ubuntu 18.04 as OS. The fact is, Docker already runs when i start my computer. Therefore, it's impossible to start MySql and Apache. it seems like the port 3306 is already used by Docker. I really to exit from Docker first for me to simply develop my app locally with just Xampp by activating MySql and Apache. What are the steps i should follow ?

I'm on Ubuntu 18.04 with Docker version 18.09.5

when i type: sudo /opt/lampp/lampp start

expected results: Starting XAMPP for Linux 7.3.3-1... XAMPP: Starting Apache...ok. XAMPP: Starting MySQL...ok. XAMPP: Starting ProFTPD...ok.

actual result: Starting XAMPP for Linux 7.3.3-1... XAMPP: Starting Apache...fail. XAMPP: Another web server is already running. XAMPP: Starting MySQL...ok. XAMPP: Starting ProFTPD...ok.

3
if you turn off your docker , you can run the apache server in your machineMohammed Yassine CHABLI
yes that's right dear. but how can i turn it off please ?shabazz87
are you using docker-compose ?Mohammed Yassine CHABLI
thanks for all the efforts, but the fact is i'm stuck to the same point on ubuntu 18.04. with the fact that i'm not able to shut down docker, to use xampp. if i come on windows, there is an icon of docker in the corner, when i right click on that, i'll just click on exit and therefore i could use xampp and start apache on windows 10. I prefer using ubuntu, but i need really help to solve this dear.shabazz87

3 Answers

1
votes

If you want to stop docker in case you are using docker-compose , use :

sudo docker-composer stop

In case you are using only docker :

First , type :

sudo docker ps 

This will list all container . so copy the container id (it's listed bellow CONTAINER ID ), and then stop it by :

docker stop conatainerId
0
votes

You can also use different ports in Docker and XAMPP For example: Docker Apache can use port 8080 and Docker Mysql - port 3307; XAMPP Apache and Mysql - ports 80 and 3306.

To do this edit your docker-compose.yml, set:

# for mysql container
ports:
  - 3307:3306

# for apache container
ports:
  - 8080:80

Port mapping should be set in format [host port]:[container port]

0
votes

You can also have the Apache web server installed in your system which starts on system startup. After system start type 'http://localhost'. If you see a web page check a default path: /var/www/html You can uninstall Apache if you want to use XAMPP for development.