homestead / php 7.2 xdebug can't get the darn debugger connected...
I've been trying all I can find to get this thing working.
I have my homestead vm installed can access it through phpstorm on my windows box (access = edit code, see changes, run configuration will start it, etc.) but I can't get xdebug configured to hit any break points.
On host system I'm using php 7.2 which apparently doesn't include xdebug by default so I found instructions on the xdebug site how to build and get it configured. Status on the server seems fine...
- Xdebug installed: 2.6.0alpha1
- Server API: Command Line Interface
- Windows: no
- Zend Server: no
- PHP Version: 7.2.0-1
- Zend API nr: 320170718
- PHP API nr: 20170718
- Debug Build: no
- Thread Safe Build: no
- Configuration File Path: /etc/php/7.2/cli
- Configuration File: /etc/php/7.2/cli/php.ini
- Extensions directory: /usr/lib/php/20170718
but I can't seem to get phpstorm (actually intellij, but same thing?) to hit breakpoints when I've enabled Listen for PHP debug connections
I've gone through just about as much as I can find to make this work, but it won't budge... I'm asking for any help on debugging (ha!) my debug configuration.
Please sign in to leave a comment.
> can access it through phpstorm on my windows box (access = edit code, see changes, run configuration will start it, etc.
Are you working with a local copy of a code/project or you're editing the code located directly inside VM (even if it's a mapped VM)?
Are you required to use PHP 7.2? I'm asking since xdebug 2.6 is still in alpha and there might be bugs. It might be worth checking this using php 7.1 and xdebug 2.5 since they're stable.
Could you also attach the xdebug part of your php.ini?
Additionally please enable xdebug logging per https://intellij-support.jetbrains.com/hc/en-us/articles/206544819-How-to-collect-remote-log-for-XDebug
Hey Dmitry,
1) My code is mapped to/from my VM to my window's client project directory so editing from either location will edit the one copy of code. So no, not a local copy.
2) php version... no not required, though a bit of a pain to roll back, and I've considered this, but would rather not if not necessary.
3) xdebug config section:
[xdebug]
xdebug.remote_enabled=1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 250
thanks,
Alright, it would be better to work on a local copy of a project instead of a mapped network drive.
Please open File | Settings | Languages & Frameworks | PHP | Servers and check mappings there (or attach a screenshot of it for us to take a look).
1) your [xdebug] section in php.ini is missing "zend_extension" though you might've enabled it while compiling xdebug(?)
2) do you have that PHP installation added into PHP CLI Interpreters? Does it show xdebug being installed there:
3) if you run a phpinfo() page using that PHP installation would it show a Xdebug section?
but I'm using a homestead (vagrant) box for my application server... the php interpreter is served from this vagrant vm, along with the ngix server it's running on. Isn't all of this supposed to be running and configured to work against a remote environment? I'm not using (?)AMPP locally, I believe this is the entire reason one would use the homestead vm?
I must be missing a very fundamental concept here since this is making less sense as I try to work through it.
With remote environment we see the workflow as following:
1) have a project COPY locally
2) configure a deployment configuration to upload project files on a remote site. This way you would upload changed files once you've edit the code and ready to test it
3) once changed code is uploaded - you run a remote xdebug configuration. Remote PHP + Xdebug CLI is run on a vagrant box against a code uploaded to a vagrant box.
During that process PhpStorm maps local file copies to remote project files in a Vagrant box.
That's the common design behind remote debugging.
I think we have a fundamental disconnect here... I'm trying to do this:
https://confluence.jetbrains.com/display/PhpStorm/Configuring+PhpStorm+to+work+with+a+VM
and it isn't working properly.
Since you're debugging via CLI, remote_connect_back has no effect - it only works when debugging via web:
https://xdebug.org/docs/all_settings#remote_connect_back
Please add xdebug.remote_host that will allow the VM to connect to the host machine.
If it still doesn't work, please enable xdebug.remote_log, start a session and check what's in there.