![]() PHONY : disable-xdebug disable-xdebug : # Disable xdebug in the given container specified by "DOCKER_SERVICE_NAME". "make enable-xdebug DOCKER_SERVICE_NAME=php-fpm" " $(MAKE) " execute-in-container APP_USER_NAME = "root" DOCKER_SERVICE_NAME = $(DOCKER_SERVICE_NAME) COMMAND = "sed -i 's/.*zend_extension=xdebug/zend_extension=xdebug/' '/etc/php8/conf.d/zz-app-local.ini'". PHONY : enable-xdebug enable-xdebug : # Enable xdebug in the given container specified by "DOCKER_SERVICE_NAME". via "make execute-in-container DOCKER_SERVICE_NAME=php-fpm COMMAND="echo 'hello'" $( if $(DOCKER_SERVICE_NAME), $( error DOCKER_SERVICE_NAME is undefined )) $( if $(COMMAND), $( error COMMAND is undefined )) $(EXECUTE_IN_CONTAINER) $(COMMAND). PHONY : execute-in-container execute-in-container : # Execute a command in a container. Simply set a break point, right-click on a file and choose "Debug '.'"įor code that is executed "directly" by a container without PhpStorm, we first need to enable xdebug in the container by removing the in front of the extension in /etc/php8/conf.d/zz-app-local.ini Derick is doing a great job at explaining xdebug in detail including some helpful videos like Xdebug 3: Xdebug with Docker and PhpStorm in 5 minutes PhpStorm will now execute tests using the PHP interpreter in the application containerįirst of all, if you haven't already please also take a look at the official xdebug documentation. Then, we add the paths to the composer autoload script and the phpunit.xml configuration file. First, we select the interpreter that we just added Phpunit is configured via File | Settings | PHP | Test Frameworks. The screenshot shows that PhpStorm adds the Xdebug extension that we defined previously. You can find the path in the application container viaĪfterwards we can set a breakpoint e.g. In addition, we define the path to the xdebug extension because it is disabled by default but PhpStorm can enable it automatically if required. docker/.envĪt File | Settings | PHP add a new PHP CLI interpreter that uses the new SSH Configuration
0 Comments
Leave a Reply. |