Chassis / Xdebug

A Chassis extension to install and configure Xdebug on your server
0 stars 8 forks source link

Xdebug config isn't set for the CLI #46

Closed johnbillion closed 6 years ago

johnbillion commented 6 years ago

The xdebug.ini file generated by this extension is supposed to get copied into both fpm/conf.d and cli/conf.d (ref), but the latter doesn't appear to happen. This means the Xdebug config in xdebug.ini.erb isn't available when using the CLI. Xdebug is available on the CLI due to cli/conf.d/20-xdebug.ini being present, but all it does is load the extension with no config.

The result is that configuration for remote debugging etc isn't present on the CLI.

Any idea what's up?

BronsonQuick commented 6 years ago

Good catch. Looking at the codebase it looks like we're missing notify => Service["php${php_version}-fpm"] for cli/conf.d

BronsonQuick commented 6 years ago

If you run vagrant ssh; sudo service php7.0-fpm restart I think it should appear. I'll have some breakfast and fix this up!

johnbillion commented 6 years ago

The config as it stands doesn't actually work for the CLI because xdebug.remote_connect_back doesn't work on the CLI (due to there not being a remote IP address in $_SERVER in the CLI to connect back to).

We might need to use a different config for the CLI. Working on it at the mo.

johnbillion commented 6 years ago

I've got this working, just need to see if I can avoid having to manually put my remote IP address into xdebug.remote_host.

BronsonQuick commented 6 years ago

@johnbillion Can you double check you have the last version of this extension? https://github.com/Chassis/Xdebug/blob/master/modules/xdebug/templates/xdebug.ini.erb#L4 was added and should do the trick?

johnbillion commented 6 years ago

Ohhh yeah that looks like exactly what was needed.

johnbillion commented 6 years ago

I'll test and confirm.

BronsonQuick commented 6 years ago

P.S. Auto updates are coming soon: https://github.com/Chassis/Chassis/pull/504

johnbillion commented 6 years ago

The new config works like a treat on the CLI and via FPM!

The config file also correctly gets moved into place (even after I manually delete it) so I guess my version of chassis/xdebug was several months old.

All good!

johnbillion commented 6 years ago

38 is what I needed