user276648
user276648

Reputation: 6373

Debug PHP called through Javascript in Aptana

I can debug my PHP scripts using Aptana 3.4. In "Debug Configurations" I simply choose "Use specified script" and when I run that script in Firefox, it automatically breaks in Aptana.

Now I'd like to know if it's possible to automatically break without explicitly loading the script: for example I open "index.htm" in Firefox, that contains some jQuery which does an AJAX call on "GetList.php". Is it possible to add a breakpoint in "GetList.php" and have Aptana break on it after opening "index.htm" in Firefox?

Upvotes: 2

Views: 536

Answers (1)

Derick
Derick

Reputation: 36784

Yes, this should be possible with some help from a browser extension. Xdebug will initiate a debugging connection when either the IDE appends the ?XDEBUG_SESSION_START=1 GET parameter, but also when a cookie with the same name is set.

The list at http://www.xdebug.org/docs/remote#browser-extensions lists extensions for each browser that allow you to set such a cookie. Xdebug notices that cookie and initiates a debugging session and as long as Aptana (or any other IDE) has an open listener for debugging connections this should work fine. THe documentation at https://jira.appcelerator.org/secure/attachment/26405/ServerPHPDebugging.pdf (page 5) explains how to set this up as well.

Upvotes: 3

Related Questions