Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Pascal Landau:
Setting up PhpStorm with Xdebug for local development on Docker
Aug 08, 2018 @ 12:44:30

Following up from his previous post about setting up Docker running PHP-FPM and Nginx on Windows 10, Pascal Landau has published the second part of the series taking things a step further and introducing (and integrating) PhpStorm and Xdebug for local development debugging.

In the second part of this tutorial series on developing PHP on Docker we're taking a good hard look at PhpStorm, Xdebug and how to run and debug scripts from within PhpStorm on Docker.

[...] The setup that I am going to use is for demonstration purposes only! I do not recommend that you use it "as is" as your development setup. [...] There will be a another part of this series that will deal with all of those (and some more common) problems and aims at providing a consistent development environment for all developers in a team (regardless of the OS they are using).

He then walks through the process from setup through actual script debugging:

  • setting up the Docker containers/configuration
  • allowing the PHP container to connect over port 2375
  • running a PHP script on this container
  • building a "workspace" container for Xdebug

For each step he provides the configuration changes needed, commands and screenshots of the settings panels to ensure its easy to follow along.

tagged: docker phpfpm nginx debugging phpstorm xdebug tutorial series part2

Link: https://www.pascallandau.com/blog/setup-phpstorm-with-xdebug-on-docker/