Tag Archives forxdebug

XDebug for PHPUnit in Docker with PHPStorm

[ update ]
Set the IP-address to the following DNS-name: docker.for.mac.localhost (yes, literally)!
Working with the IP-address doesn’t work anymore
[ /update ]

Want to get XDebug working for your PHPUnit tests which run in Docker? Or for behat? Or any other CLI application? Follow me!

Roughly this is what you’ll need to do: Continue reading

Disable xdebug for one run

This script disables xdebug for one run. No more error-messages like:


and:

This is what you’ll get

We’ll create a script which will:

  • disable xdebug
  • run your command
  • enable xdebug

the script we’ll name php-no-xdebug (or whatever you like)

With Xdebug (note the last line)


Without Xdebug (note the missing last line)

The script php-no-xdebug

Create the script /usr/local/bin/php-no-xdebug with the following contents.


and make it executable

That’s it! Run it like this:
>