Search code examples
firephp

How do I set up FirePHP version 1.0?


I love FirePHP and I've been using it for a while, but they've put out this massive upgrade and I'm completely flummoxed trying to get it to work. I think I'm copying the "Quick Start" code (kind of guessing at whatever changes are necessary for my server configuration), but for some reason, FirePHP's "primary" function, FirePHP::to() isn't doing anything. Can anyone please help me figure out what I'm doing wrong? Thanks.

<?php

define('INSIGHT_IPS', '*');
define('INSIGHT_AUTHKEYS', '290AA9215205F24E5104F48D61B60FFC');
define('INSIGHT_PATHS', __DIR__);
define('INSIGHT_SERVER_PATH', '/doc_root/hello_firephp2.php');

set_include_path(get_include_path . ":/home8/jayharri/php/FirePHP/lib");  // path to FirePHP library

require_once('FirePHP/Init.php');

$inpector = FirePHP::to('page');
var_dump($inspector);
$console = $inspector->console();
$console->log('hello firephp');

?>

Output:
NULL
Fatal error: Call to a member function console() on a non-object in /home8/jayharri/public_html/if/doc_root/hello_firephp2.php on line 14


Solution

  • The inspector variable is spelled wrong where you are assigning it and you are missing a bracket when getting the include path.

    Try the following:

    define('INSIGHT_IPS', '*');
    define('INSIGHT_AUTHKEYS', '290AA9215205F24E5104F48D61B60FFC');
    define('INSIGHT_PATHS', __DIR__);
    define('INSIGHT_SERVER_PATH', '/doc_root/hello_firephp2.php');
    
    set_include_path(get_include_path() . ":/home8/jayharri/php/FirePHP/lib");
    
    require_once('FirePHP/Init.php');
    
    $inspector = FirePHP::to('page');
    $console = $inspector->console();
    $console->log('hello firephp');
    

    Also, according to the INSIGHT_SERVER_PATH constant make sure you have a script with FirePHP installed at:

    http:://<hostname>/doc_root/hello_firephp2.php