0

I'm running the following setup for my development environment: Host system is a Windows 10 machine, running a Vagrant box with Debian Buster 64. On this client system a nginx 1.14.2 web server is running, together with PHP 8.3.0 and Xdebug 3.3. On the Windows host system I am using PhpStorm 2023.3.1 as IDE.

My Vagrantfile looks like follows in the network config section:

config.vm.network "private_network", ip: "192.168.33.20"
config.vm.network "forwarded_port", guest: 9003, host: 9003

So the client's IP is set to 192.168.33.20 and I'm forwarding the port 9003 - at least this is how I understand this configuration; please correct me if I'm wrong. When I check with hostname -I on Debian VM it also tells me this IP address.

My PHP 8.3.0 includes a config file 20-xdebug.conf which looks as follows:

zend_extension="xdebug.so"

xdebug.mode=debug
xdebug.start_with_request=trigger
xdebug.remote_handler=dbgp
xdebug.client_host=192.168.33.20
xdebug.client_port=9003
xdebug.discover_client_host=true

xdebug.log="/var/log/xdebug-rrdb.log"
xdebug.log_level=0

xdebug.max_nesting_level=-1

xdebug.var_display_max_depth=-1
xdebug.var_display_max_children=-1
xdebug.var_display_max_data=-1

xdebug.idekey="PHPSTORM"

and leads to the following settings shown in phpinfo:

Xdebug section in phpinfo

On PhpStorm I've configured a server with the following settings:

enter image description here

My debug settings are these:

enter image description here

When I now start listening for a debug connection, turn on the debug plugin in my browser and reload the page, literally nothing happens in PhpStorm. All my break points are ignored, also no window pops up, telling me that the debugger rushed through without stopping. There is also no window asking me to grant permission for an incoming connection.

I've also tried to break at the first line of any script via the global settings dialog, which also leads to no result.

What am I doing wrong or what am I missing?

I've also tried to change the xdebug.client_host to localhost which didn't work either. Destroying the machine and setting it up from scratch also didn't work.

My Windows firewall is configured to allow connections from PhpStorm to private and public networks.

5
  • #1 "please correct me if I'm wrong." You are. It's Xdebug that connects to the debug client (PhpStorm in this case) and NOT other way around. This means: 1) No need to forward Xdebug port from the host into VM 2) the client_host must be the IP of the host OS (Windows in your case) as seen from outside the VM. So look into this first Commented Dec 19, 2023 at 19:21
  • #2 For Xdebug v3.x it's better to use xdebug_info(); output instead of phpinfo() -- better structure, some troubleshooting info at the top etc. #3 "On PhpStorm I've configured a server with the following settings:" better delete it and let PhpStorm create it for you once it will get a connection. Port has to be web server port and not Xdebug. Host name would normally be the domain name (or a server name in terms of web server). Commented Dec 19, 2023 at 19:24
  • #4 xdebug.remote_handler=dbgp -- it's not used even in Xdebug v2 (simply because it's the only option anyway) so just remove that. #5 For the moment focus on those changes and look into your Xdebug log -- it will show where it tries to connect to (if at all) and what the response is. If it has nothing -- this means that Xdebug does not see the "debug me" flag (a cookie/GET/POST/ENV param) Commented Dec 19, 2023 at 19:34
  • #6 "My debug settings are these:" Instead of making that config check out "Zero config" approach when you just listen for connections: jetbrains.com/help/phpstorm/zero-configuration-debugging.html #7 Other than that: check out jetbrains.com/help/phpstorm/… and jetbrains.com/phpstorm/documentation/debugging Commented Dec 19, 2023 at 19:35
  • 2
    @LazyOne: Thank you very much for you support. My problem was the wrong IP address for the client_host paired up with a wrong port in my PhpStorm server settings, which was set to 80 but has to be 443 since I'm using HTTPS. Also I've removed the obsolete settings from my Vagrantfile and the Xdebug config. Commented Dec 19, 2023 at 22:57

1 Answer 1

1

I've had the same error. I had to downgrade PHP 8.2 because the xDebug version I used wasn't compatible with 8.3 yet.

https://xdebug.org/docs/compat

pecl install xdebug-3.2.2
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.