ActiveState Powered by ActiveState

ActiveState Community


[SOLVED] Debugging doesn't work on my Osx [Komodo 4.3.2]

Posted by kimu on 2008-05-08 06:44

I've been using Komodo before to buy a Macbook, when I worked with Ubuntu.
I have never had problem with debugging, but from the day I installed this update debugging isn't working properly anymore.

When I start a xdebug session, komodo receives the request and it opens the debug panel, but it doesn't open the file which should be debugged.
I can see on the panel that it breaks at the first line, but it doesn't show me any page where to follow the debugging flow.

I've also another problem. When I start a xdebug session it never ends. Ones the debug terminate, if I request the same page without putting in the query string ?XDEBG_SESSION_START=key it start a debug anyway.
I can close the browser, reopen it and retype the same url and Komodo inform me all the time that a debug session has been requested also if I don't ask for it.
The crazy thing is that if I ask to debug a file in a specific folder of my web server it tries to debug every single file of my web server also if it isn't in that folder.
http://192.168.244.129 is my web server ip. If a request to debug index.php under test (...129/test/index.php?XDEBUG_SESSION_START=key) it debug everything that start with that ip.

My web server is a virtual server running with VmWare Fusion. Is a linux installation with apache2 and php 5.2.

Hope that someone could help me, thanks.

jeffg | Thu, 2008-05-08 11:01

A few points to help you make sense of what is going on:

1. Komodo may not be opening the script for a couple of reasons:
a) in Preferences / Debugger, you have set the initial break to 'run to first breakpoint'. Try setting this to 'break on first executable line' instead.
b) somewhat related, make sure that you are loading xdebugin php.ini using:

zend_extension=/path/to/xdebug.so

and *not*

extension=xdebug.so

Breakpoints in Komodo will not work using the second method.

2. you may have mapped URIS leftover from an older version of Komodo, and the mapped uri system was fixed recently in a way that may break older mappings. Try this:
a) delete any current mapped uris related to your vm server
b) try initating a debugging session with the initial break behavior set to 'break on first line'.

When Komodo steps into the top-level script, right-click on the file tab and select the option 'Create Mapped Uri'. In the dialog you will see an odd-looking file:// path in the top field. Adjust this value to be the top-level directory of your application. In the bottom field, browse to the folder or remote folder where your source files are located, using the method you typically use for editing these files. Mine looks like this:

mapped-uri-dlg

In the above case, I am debugging code on a web server called 'dexter', and accessing the files via sftp. If you are using SAMBA and a 'local share' instead, browse using the 'Local' button instead.

Seems complicated I know, but it works great once it is set up correctly. Post back if you run into problems.

--
JeffG

kimu | Thu, 2008-05-08 11:53

Komodo preferences and php.ini was already correct. I've discovered that I have to map every application I have on the web server to debug it.

Your tips and expecially the example picture you give me have been very precious. Without the picture I couldn't figure out how to map URIs correctly.

Thanks!

It seems that when Komodo starts a debugging session with an ip it starts a debugging session to every url requested to that ip.
This is a bit boring cause sometimes I don't want to debug my whole web server :-). I really don't understand how to stop (definitely) a debug session with Komodo. When I request an url without the xdebug query string why it starts a debug? Do you know if there is a killer procedure to stop the debugger?

ToddW | Thu, 2008-05-08 12:00

That does seem strange that additional requests without the XDEBUG query string are also triggering debugging (that sounds like a bug to me which you may want to report).

You may want to try this little firefox helper extension to trigger xdebug on/off:
https://addons.mozilla.org/en-US/firefox/addon/3960

or, alternatively there is a bookmark that does the same thing:
http://community.activestate.com/forum-topic/toggle-php-debugging

Cheers,
Todd

jeffg | Thu, 2008-05-08 12:03

To prevent Komodo from listening for debugger requests, just go to

Debug / Listen for Remote Debugger

to toggle Komodo's debugger listener.

For convenience, you can also bind a keybinding to this command in

Preferences / Editor / Keybindings

The command is 'Debugger: Listen for Remote Debugger' and is not bound to a keybinding by default.

--
JeffG

jeffg | Thu, 2008-05-08 12:08

Also, if you are using Firefox, check out this extension for xdebug:

https://addons.mozilla.org/en-US/firefox/addon/3960

There are some other ideas about this on this thread:

http://community.activestate.com/forum-topic/toggle-php-debugging

--
JeffG

kimu | Fri, 2008-05-09 03:45

Many thanks to all for your help.

-->