You should uncheck all the breakpoints selected per default and only leave the ones you have marked in your code.įor some reason, the default breakpoints do not work with Drupal. NOTE: On the Breakpoint section (bottom left in the image above), Everything is marked as default. You should end up seeing something like this: Go to the debugger section on VSCode and run the option which says: Listen for XDebug.įinally, go to your Lando site and refresh your browser. This is a Gist for the launch.json file esnaremaussa/launch.jsonįor testing purposes, you can go to the index.php file and add $test = 1 and add that line as a breakpoint in VSCode. Note: in the port section, make sure is the same port added in the php.ini file. vscode in the root of your application and create the launch.json file with the following code: This plugin can be found here: PHP Debug.Ĭreate the folder. Make sure have installed the PHP Debug plugin. Up to this point, you should be able to run lando start and have a Drupal 9 site up and running with Xdebug listening on port 9000.įor the second part, we will be configuring the most popular IDEs among PHP developers, VSCode and PHPStorm.Ĭonfiguring VSCode with Xdebug is very simple, all you have to do is following these steps: Trust me, changing the port when experiencing problems with Xdebug may just fix all your problems and save you a lot of time wandering around. Right now, as configured above, the xdebug.log file will be located at the root of the application. The name can be anything and be located anywhere within your working directory. Very handy when things don't work as expected. The xdebug.remote_log flag is used for defining the location of the Xdebug logs. Nevertheless, if you run into issues with Xdebug, don't' hesitate to change the port to 9001 (or anything, really) and rebuild lando. Xdebug will be listening on port 9000 per default. Nevertheless, these two configuration items are very important, especially when experiencing problems with Xdebug: This is a very generic configuration for Xdebug and everything should work out of the box after running lando start. This is a Gist for the php.ini file esnaremaussa/php.ini Enter fullscreen mode Exit fullscreen mode
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |