In your docker launch a PHP command, like php bin/phpunit. Place a breakpoint somewhere in your application, as early as possible (or use the Stop at first line option provided by Netbeans, as visible in the screenshot above).īreakpoint (red square) set at line 63 here In Netbeans, click on the following icon (or ctrl F5): Make these parameters match the xdebug.ini config in your docker, as visible on the picture (fields Debugger Port and Session ID) If it looks OK, carry on, otherwise fix your config first. Xdebug.remote_log => /tmp/xdebug.log => /tmp/xdebug.log You will see such an output, reflecting your configuration (and the configuration used the next time you use the php command): In your docker, check your xdebug parameters are properly set by using the command php -i | grep xdebug. Otherwise, xdebug will be stuck inside your docker and unable to talk to the Host, where Netbeans sits. It means that the xdebug.remote_host=127.0.0.1 will also be the host IP. The line -network=host is also very important. This parameter needs (also?) to be an environment variable, so don't forget it. The line -env XDEBUG_CONFIG=\"idekey=my-ide-key\" is kind of duplicate of the xdebug.ini configuration xdebug.idekey="my-ide-key". If not, Netbeans will stop but will be unable to show you the actual line. Your project file names and directories inside your container must be the same as your host architecture. The line -v /home/me/dev/project:/home/me/dev/project is also very important. The idekey will be used in Netbeans as well as the remote port. I highly suggest to use a remote_log parameter, because if it fails, it's where you'll have valuable data. These are the required minimal configuration.
0 Comments
Leave a Reply. |