Php – Setting up IntelliJ Idea remote debugging with XDebug

debuggingintellij-ideaPHPxdebug

I have been trying to set up remote debugging in IntelliJ Idea and Xdebug for several days in a row with no success.

I have a Windows 7 host and VM VirtualBox with Windows XP as a web server. It has WampServer installed with Apache, PHP and Xdebug.

Xdebug is configured correctly:

Summary
Xdebug installed: 2.2.3
Server API: Apache 2.0 Handler
Windows: yes - Compiler: MS VC9 - Architecture: x86
Zend Server: no
PHP Version: 5.4.16
Zend API nr: 220100525
PHP API nr: 20100525
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\WINDOWS
Configuration File: C:\wamp\bin\apache\apache2.4.4\bin\php.ini
Extensions directory: c:\wamp\bin\php\php5.4.16\ext

Web server and PHP work Ok, without any issues.

Here are my steps of setting up the remote debugging in Intellij:

File->Settings->PHP->Servers
enter image description here

Run/Debug Configurations:
enter image description here

php.ini xdebug section:

[Xdebug]
zend_extension = "c:\wamp\bin\php\php5.4.16\zend_ext\php_xdebug-2.2.3-5.4-vc9.dll"
;xdebug.profiler_enable=1
xdebug.profiler_output_dir="c:\wamp\tmp"
xdebug.remote_autostart=1
xdebug.remote_enable=1
;xdebug.remote_handler=dbgp
;xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=192.168.56.1
;xdebug.idekey="intellij"

Those line commented are ones I already tried to turn on/off without success.

When I start debugging session, from IntelliJ, it opens a browser with address "http://192.168.56.101/index.php?XDEBUG_SESSION_START=some id", while debugger starts waiting on the same id.

What I have already tried:
– disable / tune firewalls
– change the default listening port
– set up "Remote debug configuration" template with manual starting debugger from browser
and many others.

I used a sniffer to make sure that my host receives something on port 9000: it indeed receives 62 bytes from the server:

enter image description here

enter image description here

but without data. Is this normal? Please give me a hint where to dig further?

Thank you all in advance.

Best Answer

The problem has finally been solved by reinstalling the web server, using XAMPP instead of WampServer. Of course it did not give me the exact answer what caused the previous configuration failure, but anyway, now it works, and I am quite satisfied with that.

Related Topic