I'm working on a freelance web development project using WAMP, but I've run into an issue where Docker keeps trying to use the same port as WAMP, particularly for Apache on port 80. I'm currently using ddev to manage this, which automatically finds open ports for me, but for my new project, I need to run two .sh files as well. However, when I try to access the project at ddev.name.site, it doesn't load correctly and just displays the raw PHP code instead of executing it. Is there a simpler way to prevent these port conflicts without relying on ddev?
3 Answers
One simple tip is to document which ports you're using and deploy your containers on different ports. This way, you'll have a clear overview of what’s assigned and can avoid overlapping assignments.
You might want to check your Docker commands and ensure they aren't set to expose the same port as WAMP. If your Docker container's configuration is set up, you can map it to another port on the host to avoid any conflicts. It can be a bit of legwork, but it’s definitely manageable!
The key thing to remember is that Docker doesn't automatically conflict with WAMP unless you tell it to use the same ports. You can easily resolve this by specifying a different host port when you run your Docker container. For example, instead of running Docker on port 80, you can use a command like `docker run -p 8080:80`. Just make sure that the port you choose is not being used by WAMP or anything else. That way, you can freely use both.

That's a good point! Just keep track of what ports you're using, and make sure to adjust your WAMP setup if necessary.