PHP xdebug only on localhost?
I'm trying to debug php pages on a remote server. But it will not work as supposed. I tried out various configurations and settings. Everything works fine when the http Server runs on the local machine. But the debugger is waitng for connection on port 9000 when trying to connect to a webserver in my local network. When trying to connect with an other Xdebug client like Eclipse everthing works fine.
But one after the other (the setup I'm using):
The server (e.g. local ip 192.168.0.1) is running with a WAMP installation (Apache/2.2.11 (Win32) PHP/5.2.6 and DOCUMENT_ROOT D:/opt/wamp/www/ )
The client (e.g. local ip 192.168.0.2) Intellij 9.0.1, Windows XP, Content Root (e.g. C:\dev\www\ , with at least one file phpinfo.php)
php.ini on 192.168.0.1
zend_extension_ts="d:/opt/wamp/bin/php/php5.2.6/ext/php_xdebug-2.0.5-5.2.dll"
xdebug.remote_enable=1
xdebug.remote_host="192.168.0.2"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_mode=req
xdebug.remote_log="d:/opt/wamp/logs/xdebug.log"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="d:/opt/wamp/tmp/"
xdebug.collect_params=On
xdebug.show_local_vars=On
PHP setting in IntelliJ
Server Root: http://192.168.0.1
XDebug port: 9000
PHP directory: c:\php\ph5.2.6 (a local php directory)
Run/Debug config: (e.g. phpinfo.php)
Web path: http://192.168.0.1/phpinfo.php
Browser: FF
Debug: Open web page in browser....
Path Mappings:
Local Client Local Server
C:\dev\www\ => D:\opt\wamp\www
I also tried to set a specific idekey in php.ini and in "wait for xdebug..." in the Run/Debug Configurations, with and without mapping, with auto mapping and so on... but allways the same problem: IDEA is still waiting for conection on port 9000.
Additionally I added the appropriate category to log.xml. -> no exceptions in the log...
So what's the/my mistake?
Thanks in advance
Max
请先登录再写评论。
Hello Max,
Thanks for the detailed description,
This is usually caused by wrong client IP specified at server's php.ini, but this is not the case since you can successfully debug in Eclipse running on the client machine.
Does the 'phpinfo.php' web page show up in the browser at all?
Could you please attach the Web IDE log with
part added to the log.xml (as you likely already done ).
Also, XDebug writes it's own log at the server, configured by
This one may also help.
Thanks,
Kirill
Hello Kirill,
yes the webpage is displayed in the browser at all. I already inserted the category in the log.xml. But there are no interesting entries, solely:
No xdebug.log will be created on server at this time!
Looking at eclipse - the settings are nearly the same (I guess):
Eclipse uses this url form debugging:
Now there's the expected xdebug.log on server starting with....
I tried out Xdebug 2.1.0beta, too. There's a new feature implemented:
but as you can imagine - no success...
...other suggestions? Has anybody else succeeded to get the debugger run with the exception of localhost?
Best regards,
Max
Hello Max,
What I see is that for some reason Xdebug is not triggered when the page is opened by IDEA.
Also please check that 'XDEBUG_SESSION' cookie is set when you open the page using IDEA and Eclipse.
Also pleaae choose the option 'Wait for Xdebug connection with ide key', specify there an Eclipse' one: 'ECLIPSE_DBGP' and try opening the page manually:
Does debug start this way?
Thanks,
Kirill
Thank you for the quick reply.
No I'm sorry, but this is still not the solution (workaround). I changed the key manually in the run/debug config to ECLIPSE_DBGP, started a browser (tried with ff and ie) - no success. It really drives me to despair.
Interestingly there's no Xdebug session cookie when using Eclipse. It's only available when IDEA tries to connect.
Removing or changing the xdebug.remote_host config in php.ini I get the expected result: the debugger doesn't work anymore ;-)
I found it! I found it! I found it!
The windows firewall caused the unnecessary stress. IDEA was not allowed to connect to.
I apologise for my mistakes. What a mess!
Thank you for your support, Kirill
Cool, thanks!