Separate Xdebug-enabled PHP container

Hi!

I’m just wondering, is it possible to configure Devilbox to run a separate PHP container with Xdebug enabled (with another “default” PHP container having Xdebug disabled)?

Something similar to this: https://jtreminio.com/blog/developing-at-full-speed-with-xdebug/

Would appreciate your thoughts/suggestions.

TIA!

I’m looking for the exact same possibility. Having the chance to route request to xdebug container or the container without xdebug based on some configuration (querystring, cookie or else) would be extremely helpful.

@cytopia do you have suggestions or ideas?

@cytopia any ideas for this one?

You could just have another devilbox run under another IP i.e. 127.0.0.2 where you have xdebug activated.

Then you just configure your /etc/hosts to point i.e. your-project.loc → 127.0.0.1 and your-project.debug → 127.0.0.2

Also you could just symlink the whole data/www directory or just your project to the other devilbox in order to have the same codebase.

I know this means that you have to maintain 2 devilbox but right now I can’t think of any other way.

Thanks for the suggestion @panigrc. But yeah, looks troublesome to do it that way. Went back to vanilla LEMP to configure things as I wanted though it also has a caveat in that the PHP version with Xdebug is higher than the mainstream (e.g. web app uses PHP 7.3 and Xdebug on 7.4). This works but have to keep in mind the PHP feature differences. I haven’t encountered major issue in this approach yet so cross-fingers.
Then again, I’ll cross the bridge if and when I encounter such a situation.

Yeah, unfortunately, I’ve reached that bridge with PHP 7.4 and xDebug installed with PHP 8.x. I’ve switched to compiling my own PHP from source with same PHP major version being used (e.g. PHP 7.4.x installed through apt and another PHP 7.4.x with xdebug enabled installed to my home dir). This is a better setup so far for me…