Allow authentication with our private key.Make the SSH server accessible from the host.
#PHPSTORM XDEBUG REMOTE INSTALL#
This gave me a starting point, so what we need to do to get it running is: PHPStorm also offers the option to add a remote interpreter over SSH. While we cannot use PHPStorms docker integration, what we can use is the SSH integration. With DDEV, that is what we would need: We have DDEV running and now want PHPStorm to execute our tests in the DDEV environment. That means, with the PHPStorm docker integration, you can use a docker image to run your tests, however you cannot connect to an existing, running docker container and use that to run your scripts. PHPStorm has a pretty good docker integration if we are talking about docker run or docker-compose run. You can also set additional breakpoints, change the value by double clicking on a variable and go step by step through the request.As I am using DDEV for most of my projects as simple docker environment for web development and PHPStorm as IDE I wanted to be able to run test from PHPStorm - not only as a script, but fully integrated with coverage and test debugging. You can now view all the defined variables in your scope with the global variables like $_SERVER, $_COOKIE, $_GET and more. In this case it is the index.php in the api directory. Here we have to select the file in which the request starts. If you now reload the website you should get a new dialog in your PhpStorm window. Now open the local website you want to debug and enable the debugging mode in the right corner of the address bar by clicking on debug in the dropdown. There should appear a red circle at the line which you clicked. You can do this by clicking on the right of the line number.
#PHPSTORM XDEBUG REMOTE CODE#
Now add a breakpoint in your code which you want to debug. This will stop at every request even if you don’t set a breakpoint. It’s also a good idea to activate “Break at first line of PHP scripts”.
We can now open our PhpStorm project and enable the debugging mode in “Run”, “Start Listening for PHP Debug Connections”. For this we can use Xdebug helper from the Chrome Web Store. Now we need a browser extension to enable the debug mode. Zend_extension = "C:\xampp\php\ext\php_xdebug.dll" We now need to replace this section with the following code: xdebug.profiler_output_name = "cachegrind.out.%t-%s" xdebug.profiler_output_dir = "C:\xampp\tmp" zend_extension = "C:\xampp\php\ext\php_xdebug.dll" For this we need to open our php.ini file (C:\xampp\php\php.ini)Īt the bottom of the file you should see the following commented section for the configuration of Xdebug. First let’s configure the our Php installation. Now that we’ve installed the Xdebug extension we need to configure it to work with our Php and Phpstorm installation. If you’re using a newer XAMPP version you should already have this file installed under C:\xampp\php\ext\php_xdebug.dll. You have to choose the right version for your installed php version.
#PHPSTORM XDEBUG REMOTE DOWNLOAD#
To start we need to download the latest Xdebug version from. With xdebug you can set breakpoints in your code, see all defined variable and even change them while running the code.