Using FirePHP with WordPress

I am trying to make it so that I can output to the console in PHP. I have already installed FireFox with the FireBug and FirePHP addons.

I downloaded the ‘FirePHPCore Server Library’ from here and I uploaded it into ‘wp-content/themes/Jupiter/includes’ (my theme is called Jupiter).

Then, from within the loop of a template page, I wrote the following code:

<?php
include_once('includes/FirePHPCore/FirePHP.class.php');
include_once('includes/FirePHPCore/fb.php');

ob_start();
FB::warn("Warning message!");
?>

I have tried to put the includes in functions.php and I have tried using the OO/Procedural calls and nothing seems to be working. What am I missing? Is there an easier way of doing this?

Warning Information

I turned wp_debug on in order to get the following output when attempting to add a debug line:

Fatal error: Uncaught exception ‘Exception’ with message ‘Headers already sent in /home5/alumnicl/public_html/beta/main/wp-content/plugins/jupiter-framework/jupiter-framework.php on line 32. Cannot send log data to FirePHP. You must have Output Buffering enabled via ob_start() or output_buffering ini directive.’ in /home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/includes/FirePHPCore/FirePHP.class.php:1178 Stack trace: #0 /home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/includes/FirePHPCore/FirePHP.class.php(757): FirePHP->newException(‘Headers already…’) #1 /home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/includes/FirePHPCore/fb.php(64): FirePHP->fb(‘hello world’, ‘Message Title’) #2 /home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/control-display.php(28): fb(Array, Array) #3 /home5/alumnicl/public_html/beta/main/wp-includes/template-loader.php(47): include(‘/home5/alumnicl…’) #4 /home5/alumnicl/public_html/beta/main/wp-blog-header.php(16): require_once(‘/ho in /home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/includes/FirePHPCore/FirePHP.class.php on line 1178

I have already included ob_start() directly before the require statement – should I be putting it somewhere else?

2 Answers
2

I use it including the file (Match you actual file location):

require '../../FirePHPCore/fb.php';

and then call by using

fb( $variable, 'Message Title');

Be sure that you’ve installed and activated the FirePHP addon on Firefox.

There’s also a WordPress plugin for FirePHP, but I’ve never used it.

Leave a Comment