![]() When XDebug is active, the status bar at the bottom of the editor should become orange. Select the ‘Listen on Docker for Xdebug’ option, then click the little green arrow beside it. At the top of the sidebar, you should now see the debug options you added to your settings file. Now, click the Debug icon in the left sidebar. ![]() In the editor, click beside the line number where you want XDebug to make its first stop and add a breakpoint. Open a project folder, and load a file into the editor. The path on the left side is the path to that folder inside the Docker container. The $ references the folder you open in VSCode. Note, adjust the pathMappings entry to match your setup. Adjust the launch section of your settings to look like this. Next, click the Debug icon in the left sidebar, then under ‘Run’ from the main menu, select ‘Add configuration’. You can install it through the plugin tab in VSCode. ![]() I recommend PHP Debug from the XDebug developers. Setup VSCode to properly connect to XDebugĪs a first step, you will need to install a PHP debugging plugin in VSCode. You should see that XDebug is now correctly installed.ĥ. Start your container and visit it in your browser, loading xdebug_info.php. Start your container and test to make sure everything worksĬreate a file named xdebug_info.php in your container’s document root, and the following lines to it:
0 Comments
Leave a Reply. |