简体   繁体   中英

Setting up IntelliJ Idea remote debugging with XDebug

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 在此处输入图片说明

Run/Debug Configurations: 在此处输入图片说明

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:

在此处输入图片说明

在此处输入图片说明

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

Thank you all in advance.

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.

in intelliJ IDEA install xdebug 1st correct settings for xdebug on intelliJ IDEA on windows wamp is look for php.ini file find xdebug at bottom,after zend extension paste following and then restart wamp server it working for me very well

 [xdebug] xdebug.remote_enable = On xdebug.profiler_enable = On xdebug.profiler_enable_trigger = On xdebug.profiler_output_name = cachegrind.out.%t.%p xdebug.profiler_output_dir = "c:/wamp/tmp" xdebug.show_local_vars=0 xdebug.remote_host=127.0.0.1 xdebug.remote_port=9001 xdebug.remote_handler=dbgp xdebug.remote_autostart=0 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM