I have installed MySQL and apache using brew on my local machine and have been using them for several php project environments. Now i want to start learning docker to containerize a new Laravel environment (example) . Before i start using docker on my local machine, should i stop the httpd and mysql service ? will the 'php' and 'mysql' command have a conflict ?


The only issue you might have running the same services in containers as locally on your machine is a port conflict. Let's take httpd as an example:

  • You try and start the container and you get listen tcp bind: address already in use. This is because a HTTP server is already running on your machine.
  • Tell docker to bring the container up using a different local port: docker run -p 80:8080 <your container, commands etc>. This will tell Docker to bind port 80 in the container to port 8080 on your machine.
  • You can now access both http://localhost:80 (your machine) and http://localhost:8080 (the container).
  • will there be a conflct with mysql and php command in terminal ?
    – Padawan
    Jul 22 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.