Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Debugging AJAX calls using XDebug
 
martinkaiser
Jr. Member
 
Total Posts:  7
Joined:  2008-01-10
 

Hi!

I need to debug the AJAX calls using XDebug (like OnOrderValidate in Payment Modules).
To enable XDebug I need to add ?X_DEBUG_START_SESSION=default or similar to the URL.

Does anyone know a central location to add this parameter to the AJAX URLs?
Or another idea how to debug these AJAX calls?

Thanks, Best Rgds,
Martin

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mark_Kimsal
Sr. Member
 
Total Posts:  186
Joined:  2007-09-12
Michigan, USA
 

Do you need to debug the PHP activity that is caused by the AJAX, or just the traffic of the AJAX?

If it’s just the traffic, you can try wireshark.  It will show you all the packets that move around on your network, and then you right click one that looks like HTTP and choose “follow tcp stream” and it shows the whole conversation.

If you need to debug the activity of the PHP, you can load up your page, edit your php ini file to turn on xdebug (make debugging on by default), restart the web server, then trigger the ajax call.  It’s a bit of extra work, but I don’t how much or how often you need to debug.

 
Magento Community Magento Community
Magento Community
Magento Community
 
martinkaiser
Jr. Member
 
Total Posts:  7
Joined:  2008-01-10
 

Thanks. I need to debug PHP caused by AJAX calls.

Here is the Xdebug part of my php.ini:

[XDebug]
zend_extension_ts="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req

But debugging only works if I set the XDEBUG cookie using the firefox addon. Unfortunately breakpoints in the payment modules are not working.

Thanks, Best Regards,
Martin

 
Magento Community Magento Community
Magento Community
Magento Community
 
digital magento
Jr. Member
 
Total Posts:  14
Joined:  2009-08-19
 

same problem, how to debug AJAX calls ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
subesh
Sr. Member
 
Avatar
Total Posts:  145
Joined:  2009-01-08
 

You can use Firebug..or see here.. http://subesh.com.np/2010/01/debugging-magento-eclipse-pdt-zend-debugger/

 
Magento Community Magento Community
Magento Community
Magento Community
 
harikaram
Member
 
Avatar
Total Posts:  54
Joined:  2008-07-27
 

Any updates on this?  I can’t get Netbeans to break into debugging for PHP files called via AJAX.  XDC seems to work but Netbeans would be much preferred for obvious reasons…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top