views:

198

answers:

2

I'm trying to debug some PHP using NetBeans PHP 6.8 with XAMPP on Windows and setup xdebug in php.ini. The step by step seem working fine but when there is a critical exception on the website in the PHP, NetBeans doesn't break on it.

I heard about adding a break-point on Exception but I couldn't find it in NetBeans 6.8. The Ctrl + Shift + F8 doesn't let me break on "Exception", only "Method".

+1  A: 

Like your comment says, you generally need to have the remote_mode set to 'jit'.

If debugging isn't working, there are a few things you can check:

  • Add a xdebug_break(); line in your code, and see if the debugger fires.
  • Add some logging into your php.ini/xdebug.ini file:

    xdebug.remote_log="C:\temp\xdebug.log"
    

    Look at that log file to see if you are getting breakpoint events mentioned.

  • Check phpinfo() to see you have output like this:
        This program makes use of the Zend Scripting Language Engine:
        Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
            with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans  

If you don't have the "with Xdebug" line, even if you have a complete set of xdebug options listed, you will get output, xdebug_break() debugging, but no user-set breakpoints. This could also be your problem with exception breakpoints.

The general cause for this is loading the xdebug extensions the wrong way. You need to load it as zend_extension=/path/to/xdebug.so - remove any other lines loading it starting with "extension=" or "zend_extension_ts=".

crb
A: 

Also if you are using xDebug it might be a good idea to activate the profiler

On windows you can use WinCacheGrind to read the file.

AntonioCS