I have added FirePHP but I can not get message from the PHP file.
<html>
<h1>Test</h1>
<?php
if ((include 'fb.php') == TRUE) {
echo 'OK';
}else{
echo "nok";
}
header("Content-type: text/HTML");
$data="my data";
var_dump($data);
ob_start();
FB::info('Hello, FirePHP');
ob_end_flush();
?>
</html>
code is stripped down and very simple. When I load the page the include message (ok) and the variable $data can be seen.
But the FB::info() does not show up in the console.
Include works so lib fb.php is included. FirePHP is enabled
I have installed FF developer and FireHP extension
What can I do?
First make sure the FirePHP extension is working by going to http://firephp.org/ and enabling it. You should see messages in the FirePHP console.
Your code is likely sending output before FirePHP can send the response headers which is a problem. You need to start buffering the output at the very beginning of the script so that FirePHP can send the headers at the end.
Something like the following should work:
You can also configure PHP to automatically buffer output and flush it at the end. That way you can omit the
ob_*()
calls. You can even configure PHP to auto-includefb.php
so that you do not need to include it in every script.