NOTE: The information below assumes you are using the FirePHPCore library. Please refer to the server libraries section in the wiki for information on how to log messages with 3rd party frameworks and libraries.
Setup Let's assume your document root is /www/ and it is in your PHP include path. Step 1 Locate the server library Locate the /lib/FirePHPCore folder in the FirePHPCore archive and move it into your document root.
/www/FirePHPCore/fb.php
/www/FirePHPCore/FirePHP.class.php /www/FirePHPCore/LICENSE You can skip this step if you are using PEAR. Make sure the PEAR repository is in your include path. Step 2 Include the server library Create a file at /www/Index.php and open it in your editor. require_once('FirePHPCore/FirePHP.class.php'); Step 3 Start output buffering ob_start(); You can skip this step if the output_buffering php ini directive is set to On. NOTE: The output buffer may NOT be flushed to the browser as long as you want to log messages with FirePHP. This is important as messages get sent in the response headers which must be sent prior to any page output. |
Your first log message $firephp = FirePHP::getInstance(true); $var = array('i'=>10, 'j'=>20); $firephp->log($var, 'Iterators'); Access Index.php via Firefox (e.g. http://localhost/Index.php) Ensure your Firebug Net AND Console panels are enabled. You should see something like this: Note: The File and Line information will only show when you hover over the message. Hovering over array(...) will show the Variable Viewer. Clicking on the array keys will toggle the values. |
评论