![]() ![]() You would implement each of these approaches in your webserver-container's /etc/php directory. The important thing you need to change from most default php containers is either the php.ini file or you can completely add a new xdebug.ini file to hold your configuration. The latter can be completely ignored for setting up a tool like Xdebug. Most of the time there are two containers in use. So what basically is my setup for local development?! Since roughly 1 1/2 years now I completely switched from using Vagrant VM's in favor of setting up my local environment with Docker, using Docker Compose. But since I personally changed to VSCode and very much rely on using Xdebug I wanted to get this to work there in connection with Docker too. ![]() Until some months ago I used PHPStorm from Jetbrains and for this IDE the setup of Xdebug is very well documented. This gives you the ability to inspect for example the current value of variables as your code is executed and you can "step through" your code to debug it. What this means is that you don't have to rely on using var_dump()'s and stuff like that to debug your code anymore as you can define breakpoints in your IDE on which the debugger will stop the code execution and reveal the current state of your code. Why would I want to use something like Xdebug in my local development workflow at all?! The answer is quite simple: Xdebug is an php extension that aims to assist while developing php applications as it implements (apart from other stuff □ ) a single step debugger that you can use in the context of your IDE. After I had to google around for this for the third time or so, I decided to write down my setup for Xdebug in an Docker environment while using VSCode so maybe someone trying to get this to work will have an easier time than I had :P.īut first things first.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |