XDebug on remote server
Posted December 10th, 2007 by PhilippFeigl
Hi,
I have the following setup:
VS 2005, SP1, VS.Php 2.4, Linux webserver + XDebug 2.0.2
Everything is running fine so far and xdebug seems to work great, as I can use the native xdebug client to connect to my remote server.
I have setup XDebug to listen to the correct host machine using port 9000.
However, when I try to debug code with VS.Php, the vs debugger starts up, a website pop ups with the XDEBUG get info attached and I also see, that on the serverside, the debugger instance is started.
My Problem is, that any breakpoint is blanked with the message "The breakpoint will not currently be hit. Unbound breakpoint".
Does anyone else have the same issue and is there a solution to it?
Thanks,
Philipp
| Attachment | Size |
|---|---|
| debugger.zip | 523.65 KB |


XDebug won't complain if it
XDebug won't complain if it fails to connect to the IDE. Check the listening port for VS.Php in the project->debug->advance settings. Make sure it is 9000.
Thanks
I've verified, that the port
I've verified, that the port is 9000 on both, the IDE and the XDebug setup.
Not working yet :(
Are you loading the module
Are you loading the module as an extension or a zend_extension? I've seen that breakpoints only work if loaded as a zend_extension.
Thats a good point! I've
Thats a good point!
I've loaded it as a normal extension, as it didn't load as a zend_extension at all.
Will give it some more tries as a zend_extension, possibly I find a solution for it.
Thanks
I have exactly the same
I have exactly the same problem. Can't get it to load as a zend_extension.
I got it running as a
I got it running as a zend_extension now. I was using zend_extionsion_ts= as of the docu, because I'm using Apache 2.x
When using zend_extension=, it loads as expected.
However, XDebug debugging still doesn't work.
I also realized, that I was using XDebug 2.1dev and not 2.0.2. I have now patched downside to 2.0.2 and it's still not working.
But it seems to be a new problem. While with 2.1dev the website seemed to "stuck" until I stopped debugging, it now simply runs through to its endresult without breaking at any breakpoint :(
Does VS.Php create any log, whether it "heared" from the debugger and which response it estimated and what resopnse it got and so on?
As we are all developers, I guess we could give you good feedback, what our problems are, when we get some log information.
Regards,
Philipp
There are some traces you
There are some traces you can see with DbgView. I'm not sure if the release version of VS.Php puts traces for the debugger. If not, I can get you the debug version.
This would be great to get a
This would be great to get a debug version.
Currently I could not find any traces / logs / similar in the vsphp install directory.
XDebug never reaches a breakpoint
I Have VS 2005 with VS.PHP 2.4, and am attempting remote debugging with XDebug. When I start the debugger, the browser launches with XDEBUG_SESSION_START in the URL. All of the pages render correctly, but no debugging information is available in Visual Studio. It's like i'm not even running a debugging session at all. My settings are as follows:
VS.PHP:
Active(Remote), External Mode, PHP/Javascript debugging, XDebug, Port 9000
PHP.ini:
zend_extension_ts="C:\PHP\ext\php_xdebug-2.0.2-5.1.7.dll"
[XDebug]
xdebug.idekey = vsphp
xdebug.remote_enable = 1
xdebug.remote_host = 192.168.2.47
xdebug.remote_log = C:\PHP\xdebug.log
xdebug.remote_port = 9000
xdebug.remote_mode = req
xdebug.remote_handler = dbgp
xdebug.allowed_clients = 192.168.2.47
phpinfo shows that XDebug is installed, but the log file is empty.
What am I doing wrong?
Something to double-check is
Something to double-check is that 192.168.2.47 here should be the host running the VS.Php IDE, and in the project settings it should be configured to listen on port 9000 for debugging. If the server running Xdebug tries to connect to 192.168.2.47:9000 but the port is closed, it will display the page without running it via the VS.Php debugger.
Otherwise, perhaps check the output of phpinfo() to make sure the server is using the settings from that php.ini (just in case it isn't actually loading the php.ini you provided).
Hope that helps!
Traces
I'm including a debug version of the debugger which contain traces that can be viewed with DbgView. This can help us find out what the problem is
http://www.jcxsoftware.com/jcx/files/debugger.zip
Thanks!
Thanks!
I have initiated a debug and this is the log results:
http://www.philippfeigl.de/downloads/xdebug_remote.log
Again just to get sure, this is my configuration / setup
Projectsetup (Name: BackOffice)
-- backoffice.host.com (which is the wwwroot folder and points to x:\backoffice\backoffice.host.com)
-- libs (which is the libs folder holding all included files and points to x:\backoffice\libs)
Project configuration:
Include directories: .;libs
Debug Mode: External Mode
Debug Type: PHP
Engine: XDebug
Start Url: http://backoffice.dev.host.com/bb4admin/silverwire/index.php (This will not be reachable for you, as it simply points to my local development machine)
Browser: Default Browser
Port 7870
Server configuration is XDebug 2.0.2 with PHP 4.3.9 and seems to work in general. Port is also set to correct number.
What wonders me in the DbgView log is the fact, that RemotePath is empty.
However according to the Log, the xdebug engine reports the correct correct server path to the file, which is:
fileuri="file:///misc/uploads/backoffice/backoffice.host.com/bb4admin/silverwire/index.php"
Btw, my X:\ drive is just a samba share to /misc/uploads/ on the remote server.
Perhaps this helps you to identify my problem. Thanks
Philipp
XDebug issue fixed
Please try out the latest build that fixes the problem with breakpoints on XDebug and remote servers.
http://www.jcxsoftware.com/jcx/vsphp/beta
Thanks,
Ok, I digged a little bit
Ok, I digged a little bit deeper into the thing now and there is one thing, that wonders me a little bit:
The XDebug log says the following:
<- breakpoint_set -i 9 -t line -f file://X:/pretty/long/path/index.php -n 9 -r 0
Now, file://X:/ will not be available at all on the unix machine. Therefor I fear, that XDebug is not able to set the current breakpoint for the session.
Could this be the problem and if yes, can I fix it?
Thanks,
Philipp
VS.Php should be mapping
VS.Php should be mapping this path to the remote server path based on the initial request. A debug trace of vsphp_dbg.exe would help us determine why that is not happening. Perhaps the start url does not map to the remote server?
You should use a start url that starts in the root directory of your application. All breakpoints will should work as long as they are inside that root directory.
Thanks,
[quote] You should use a
[quote]
You should use a start url that starts in the root directory of your application. All breakpoints will should work as long as they are inside that root directory.[/quote]
Thats a tough one, because my project is not directly connected to root webserver.
I have the following File structure:
Project
- wwwroot
- libs
- some other folders
So, while my project would have the file Project/wwwroot/index.php, from the view of the Webserver its host/index.php.
Do I have to restructure it, so it reflects something like this:
Accessible Scripts Project
- Sources
Library Project
- Sources
Thanks for your help,
Philipp
Perhaps you can create the
Perhaps you can create the project with the root directory been "Project" and wwwroot and libs been the subdirectories. That way everything will work just fine.
Juan
Yet Another Remote XDebug Question
I had this working at one time, but not anymore. I set one breakpoint and hit F5. Here is the xdebug log on the server.
<- feature_get -i transaction_id -n supports_async-> <response command="feature_get" transaction_id="transaction_id" feature_name="supports_async" supported="1"><![CDATA[0]]></response>
<- feature_get -i transaction_id -n notify_ok
-> <response command="feature_get" transaction_id="transaction_id" feature_name="notify_ok" supported="0"><![CDATA[0]]></response>
<- stdout -i 3 -c 1
-> <response command="stdout" transaction_id="3" success="1"></response>
<- stderr -i 4 -c 1
-> <response command="stderr" transaction_id="4" success="0"></response>
<- breakpoint_set -t exception -x "Fatal error" -i 5
-> <response command="breakpoint_set" transaction_id="5" id="85530001"></response>
<- breakpoint_set -t exception -x "Parse error" -i 6
-> <response command="breakpoint_set" transaction_id="6" id="85530002"></response>
<- breakpoint_set -t exception -x "Unknown error" -i 7
-> <response command="breakpoint_set" transaction_id="7" id="85530003"></response>
<- breakpoint_set -i 9 -t line -f file:///var/www/html/login.php -n 4 -r 0
-> <response command="breakpoint_set" transaction_id="9" id="85530005"></response>
<- run -i 10
-> <response command="run" transaction_id="10" status="break" reason="ok"></response>
<- stop -i 11
-> <stream type="stdout" encoding="base64"><![CDATA[]]></stream>
-> <response command="stop" transaction_id="11" status="stopped" reason="ok"></response>
My xdebug section of php.ini looks like this:
; Enable xdebug extension modulezend_extension=/usr/lib64/php/modules/xdebug.so
[XDebug]
xdebug.idekey = vsphp
xdebug.remote_enable = 1
xdebug.remote_host = 192.168.15.20
xdebug.remote_log = /tmp/xdebug.log
xdebug.remote_port = 9000
xdebug.remote_mode = req
xdebug.allowed_clients = 192.168.15.*
The breakpoint doesn't get hit. Sometimes the page renders and sometimes it doesn't. My VS2008 w/VS.PHP 2.4 is on 192.168.15.20 and the project is set for Remote, Debugging, Port 9000. Thoughts?
Thanks!
Mike
Big kudos for the update.
Big kudos for the update. Installed latest version, set breakpoint, hit f5, WORKS! Bam, thank you!