FirePHP is an addon for FireBug extension for Firefox browser.
FirePHP extends FireBug functionalities to show log or error messages coming from your PHP application. These messages won’t be printed on the application interface but instead on the FireBug console.
What do you need to integrate this debugging feature in your application :
The next step is to open Firefox and visit the url where your application is located and activate the Net panel in FireBug, clicking the bottom right Firebug icon in Firefox window.

The client (the browser), is now ready to accept the debugging messages, we have now to integrate the FirePHP library with the CodeIgniter application on server side :
- dowload the FirePHP Core Library from here
- extract the
FirePHP.class.phpfrom the archive, rename it tofirephp.phpand copy in thesystem/application/librariesdirectory of your CodeIgniter application
Now you can use FirePHP to debug your code :
- load the library :
$this->load->library('firephp') - send debug messages to the FireBug console :
$this->firephp->log($myvariable)or$this->firephp->error('Error at this line')
Detailed instructions to use FirePHP are available on FirePHP project website. The most useful method for me are :
$this->firephp->log($myvariable): send a dump of the variable$myvariableon the FireBug console$this->firephp->warn($myvariable): send a dump of the variable$myvariableon the FireBug console classified as a warning$this->firephp->error($myvariable): send a dump of the variable$myvariableon the FireBug console classified as an error
Here there is a little example on how you can use FirePHP with CodeIgniter :
And this is the output on the Firefox’s FirePHP console :

The debug messages can be disabled with the method : $this->firephp->setEnabled(FALSE).
It is also possible to make the messages appear only for specific ip addresses :
Suggested books



“load the library : $this->load->library(‘pdf_label’)”
I think you mean to load FirePHP, not pdf_label
Corrected, many thanks.
I’ve been working also on integration of FPDF library in CodeIgniter at the same time
Hello,
I installed firephp, but seems like my server absolutely refuses to send the firephp headers… so it’s not working. I tried it outside CI also, but it doesn’t work. I’m stuck..
Do you have any idea where the problem can be?
Thank You :>
Seems line IT IS working, but only on windows.. I was based on the lack of headers, but trough FireBug, which is working but is also broken. So the problem is somewhere there > http://groups.google.com/group/firebug/browse_thread/thread/7c1a9c0886d98070/6791b68e3a829ceb
Hi I think its very interesting your article put the most important for me is to debug step by step in a IDE like Aptana, Zend Studio for Eclipse or others. My question is: What IDE for PHP can debug a MVC framework like CodeIgniter? The only framework with this capability in the market is Zend framework because it works with Zend Studio for Eclipse thats hides how it do this and has many cute things like whole perspective for Zend applications….
Now am making an complex Ajax application with Ext JS and CodeIgniter; and Aptana is the best untill now thats make the best intelisence for Ext JS (and many others Javascript libraries) and I have got It do the same with CodeIgniter, with Zend Studio for Eclipse I have got none good integration with Ext JS library but it does better integration that Aptana for CodeIgniter, even got that make me the clases by the menu option. I suppose that many of you has problems like this, and I would like somebody tells me if makes advances in things like this but mainly debugging MVC(Model-View-Controller) php applications, any thing I could help write me to my mail. Thanks
Hi Eliecer.
I don’t use any IDE to develop, but only gedit with some extensions (my operating system is Ubuntu).
Perhaps you could consider a more sophisticated debugging system like Xdebug. See here how to use Xdebug with Eclipse.
Try PHP Designer by http://www.mpsoftware.dk/ to edit your code. it’s fairly good with the MVC code.. As with anything it could be better, but the developer who wrote my website (In CI) loves it.
-Brad
Hi. Many thanks for the suggestion.
Roberto
Hi.
I suggest to try free PHP IDE – Codelobster PHP Edition with own PHP debugger. It has also very useful special CodeIgniter plug-in.
Stas.
hi, nice tutorial,
i wanted to add that i had to update from 3.0.1.6 firefox to 3.6 and upgrade firebug
before firephp would display headers correctly.
I am trying Code Lobster for Codeigniter
Will post my experience here after my testing.
Hey, thanks for the info.
The debug messages can be disabled with the method : $this->firepgp->setEnabled(FALSE).
You mean $this->firephp, not $this->firepgp