tomsik68 / docker-xampp

Dockerfile to build an image containing XAMPP(MySQL + PHP + PHPMyAdmin) running on Debian system with SSH server
https://hub.docker.com/r/tomsik68/xampp/
MIT License
189 stars 107 forks source link

Install xdebug #66

Open tamthong1115 opened 2 months ago

tamthong1115 commented 2 months ago

Hello,

I'm running Docker on Linux. I use the following command to start the container:

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

How do I install and using xdebug with vscode? Thank you!

tomsik68 commented 2 months ago

Hey,

I know you'd definitely have to:

  1. Install xdebug into the docker image using sudo apt-get install php-xdebug
  2. Add the following line to php.ini: zend_extension=xdebug

From then, xdebug says "it'll connect to your IDE" which I don't believe would happen in the docker container.

You should try playing with setting up dbgpProxy: https://xdebug.org/docs/dbgpProxy. I think you can start dbgpProxy inside the container and then forward its port to your machine. That could help.