Search code examples
phpcomposer-phpxdebugxdebug-3

Xdebug not available in Composer plugin


I'm trying to debug a Composer plugin with Xdebug. I have my environment set up (export XDEBUG_SESSION=1) and the Xdebug loaded in php.d. The script breaks at first line in Composer so everything works so far.

In a composer-plugin class method code I add an xdebug_break(). What I get when that code gets executed is Uncaught Error: Call to undefined function xdebug_break().

Does Composer spawn a crippled shell of sorts without the environment set or runs PHP without extensions? How can I fix this to debug the Composer plugin?


Solution

  • Found myself the answer: As per Xdebug documentation,

    export COMPOSER_ALLOW_XDEBUG=1
    

    did the trick.