I was able to install and setup quite easily NetBeans 6.9.1 and Xdebug on my local environment, based on PHP 5.3.0 (XAMPP).
My problem now is the following: if I put a breakpoint on Wordpress's index.php or other Wordpress core PHP files, NetBeans correctly stop at desired position. If instead I put a breakpoint on a plugin file, an trigger the code execution NetBeans does not stop there.
Do you known how can be solved?
UPDATE: More info about what I am trying to debug
Plugin is called Vanilla Forums and has the following file structure:
- plugins
- vanilla-forums
+ assets
+ nbproject
+ templates
admin.php
embed.php
functions.php
hooks.php
plugin.php
sso.php
widgets.php
I set the breakpoint inside a function named vf_validate_options
defined in functions.php
. I am sure that this function is executed, but NetBeans does not break there.
I was able to install and setup quite easily NetBeans 6.9.1 and Xdebug on my local environment, based on PHP 5.3.0 (XAMPP).
My problem now is the following: if I put a breakpoint on Wordpress's index.php or other Wordpress core PHP files, NetBeans correctly stop at desired position. If instead I put a breakpoint on a plugin file, an trigger the code execution NetBeans does not stop there.
Do you known how can be solved?
UPDATE: More info about what I am trying to debug
Plugin is called Vanilla Forums and has the following file structure:
- plugins
- vanilla-forums
+ assets
+ nbproject
+ templates
admin.php
embed.php
functions.php
hooks.php
plugin.php
sso.php
widgets.php
I set the breakpoint inside a function named vf_validate_options
defined in functions.php
. I am sure that this function is executed, but NetBeans does not break there.
5 Answers
Reset to default 2There is an easy solution with a Firebox extension Xdebug Helper by Brian Gilbert. This sets cookies for the xdebug
session which allows you to use xdebug
within your WordPress plugins.
There are also extensions for Chrome, Safari and Opera. The links can be found on the xdebug website
You've followed these instructions right?
http://codex.wordpress/Testing_WordPress_Performance
Hi @Drake:
Stupid question, I know, but have you "activated" the plugin? That's where I trip up when plugins are not being debugged.
there is no way to debug the plugin's files. The only way I found for debug wordpress is to use nusphere phped wich is , unfortunately, not freeware. That seems the only one can do that, I don't know why but I spend very long time figuring how to debug with netbeans and eclipse...with no results!
Well, since WordPress itself provides WP_DEBUG
, and wp_die($msg)
... why whould you need to debug with Xdebug? Unless you are building your plugin using a framework?
throw new Exception('die');
statement after the line of the breakpoint, does it then stop (in the meaning that this kills/ends your request)? – hakre Commented Feb 16, 2011 at 9:51XDEBUG_SESSION_START
query parameter to all requests. – Jeff Stieler Commented Jun 13, 2011 at 13:34