开发者

Which is the best way to debug PHP in WordPress?

I have tried several methods to debug PHP code in a hosted WordPress 3.1 installation, however nothing seems to offer what I need. Both plugin based consoles and browser based cons开发者_JAVA百科oles create more problems that the ones that I need to solve.

I am looking for a simple text/html popup window that will launch as soon as the code hits a function in the code. The function argument (debug info) can just be displayed in the popup.

At the same time ideally would be to record all the debug info in a log file on my desktop.

Help!


I haven't used it yet, but FirePHP looks promising for capturing loggin messages and the like. It's an addon to FireBug.


After experimenting with several methods & ways, for my purposes i concluded that dbug (http://dbug.ospinto.com/) is the quickest & cleanest way to get immediate and inline information & data on PHP objects, arrays, etc.

You just need to include the class and to call the function whenever you want. I used it for a wordpress / buddypress project and I was filtering the debug statements with my user account.

include it include_once("dBug.php");

use it if($bp->loggedin_user->id == '4') {new dBug($entry);} //dbug statement

:)


FirePHP cannot print anything after the headers where sent. It is not a debugging method, but a logging method. You need IDE like CodeLobster or PHPEdit (not free) or the best is Zend Studio

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜