![]() ![]() And after the container is up, I check the directory and the file isn't there. I assume that is because in the file it has a COPY command to copy a file (called 90-xdebug.ini) from my project to a specific directory. I use VSCode and somehow this debugger it's not working.Īpparently the Dockerfile is not been executed when I use docker compose up -d command. Once you do so, you can just start the container and execute the script, and then you will see the client that was waiting connecting and getting into interactive mode.I'm trying to create a docker container with PHP and Xdebug to use step debugging. ![]() docker/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini You will get a json structure and there you need to pick the ip from IMAP > Config > Gateway.ĭon't forget to setup the configuration files ont he volumes section of the docker-compose.yml file so it gets copied to the container. ![]() Now here it comes the tricky part, the client_host ip changes and you need to figure out which one is yours, in order to do so you need to inspect the docker network your container is running in using docker network ls and docker network inspect with the network identifier. docker/php/conf.d/xdebug.ini and put there the following configuration parameters. That would install it when building the container, and for configuring it we need to copy the configuration into the container, so I will create the following configuration file into a folder in my project like. To install Xdebug the following lines need to be added to the Dockerfile. ![]() The next thing is going to be installing and configuring Xdebug inside the docker container, and make it connect the host machine in that port. Waiting for debug server to connect on port 9003 Now the debugging client will be waiting for connections on our host machine, the following message will be prompted: There are thousands of articles for setting up debugging on a complex IDE like PHPStorm, but if you like minimal configurations like me, you can just download and run the minimal DBGp client from the official Xdebug website.Ī simple way of doing this would be: wget This brief post will be more like a note for my future self, to know how to setup Xdebug for debugging complex problems on PHP code that is running inside a Docker container. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |