Setting up FirePHP with CodeIgniter

In: PHP

17 Sep 2008

I have been using FireBug for some time now. Although his prime purpose is for JavaScript debugging I use it mostly for fast drilling down to CSS stuff. I just love the possibility to change, delete or add CSS properties on HTML document on the fly. Anyway I like FireBug. In absence of one for all IDE it’s quite decent solution for debugging.

Contrast to JavaScript development I do a lot of PHP development. Sadly to say, I am hugely disappointed to PHP debugging solutions. I know there are few solutions out there like XDebug but they are simply no match to Microsoft’s Visual Studio debugger. Anyhow, a free is a free so be grateful.

Currently I’ve been working on a project that will use CodeIgniter as it’s framework, It’s my first project and my first MVC application from ground up. To make my life easier, I decided to download and install myself an FirePHP extension for Firefox and FirePHP library.

Here are few steps you need to take in order to install FirePHP to work with CodeIgniter

  1. Download and install FirePHP extension from net (link)
  2. Download FirePHP library from their official site (link) and save it to some local folder
  3. Download CodeIgniter stuff for FirePHP from CodeIgniter site (link, or use direct link to version 0.1.1 as of time of this writting, link)
  4. Extract FirePHP library you downloaded in step 2 and only copy FirePHP.class.php to CodeIgniter /application/libraries/ folder, but give it a name FirePHP.php without the class part
  5. Extract the file you downloaded in step 3 into appropriate CodeIgnite folders. Please rename original /application/controler/welcome.php to _welcome.php just in case for backup purpose
  6. You are almost done. Now you need to be sure that PHP’s output buffering setting is turned on. I use WAMP package so turning this option on means clicking on WAMP icon in tray area, then selecting PHP > PHP Settings > Output buffering
  7. Start your Firefox, click the FireBug icon on the bottom lower area, or go to menu and select tools. After you turn on (set them to enable) FireBug and FirePHP, be sure to click on the Net tab next in line to HTML, CSS, Script, DOM and set it also to enable.
  8. Thats it. Your FirePHP should work now. Refreshing firefox window and clicking on FireBug’s Console tab should give you “hello” message. This “hello” comes from the welcome.php file located in archive file we downloaded in step 3.

It took me few minutes to figure some of this things out by myself since online documentation that goes with these files does not give step by step instructions.

This walk trough worked for me, so I hope it will work for you as well. If you have any questions, feel free to mail me using Contact menu at the top if the page. I’ll try to answer as soon as possible, no guarantees since I’m quite short on time.

Hope this was helpful.

Interesting? Share it!
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • Facebook
  • TwitThis
  • description

6 Responses to Setting up FirePHP with CodeIgniter

Avatar

James

September 17th, 2008 at 8:21 pm

Hi, I found your blog on this new directory of WordPress Blogs at blackhatbootcamp.com/listofwordpressblogs. I dont know how your blog came up, must have been a typo, i duno. Anyways, I just clicked it and here I am. Your blog looks good. Have a nice day. James.

Avatar

Lawrence

September 18th, 2008 at 8:40 pm

Hey,
Thanks for the tutorial, I have been trying to get firephp working on CI for a little while, it seemed as though the project was abandoned.

Avatar

lazy fri13th

September 23rd, 2008 at 1:10 pm

thanx alot. it was very helpful to me.

there was only a small issue when i tried your recipe.
FirePHP.php in libraries folder doesn’t work correctly.
so i change the name to Firephp.php and works fine.
Just An FYI.

Avatar

Vizor

November 15th, 2008 at 7:37 am

Thank You for tutorial.

Avatar

abhishek

December 10th, 2008 at 4:25 am

hi…..thanks for the tutorial…i am not able to get this work with codeigniter 1.7 i am get a error regrading the parent controller which need to be changed from
parent::Controller (); to parent::MY_Controller(); in the controller as per the instruction in http://codeigniter.com/wiki/Fire_Ignition/ can u please help me out in this

Avatar

Julian

March 24th, 2009 at 4:00 pm

Thank you for the info.
Congratulations for the blog. I added it to my reader ;)

Comment Form

About this site

Branko Ajzele Welcome to ActiveCodeline. My name is Branko Ajzele. I'm 26-year-old, currently working as full time PHP web application developer at Inchoo (in partnership with Surgeworks). My special interest and expertise evolve mainly around Zend Framework, Doctrine ORM, Magento eCommerce platform and few other related technologies.

More about me?
View Branko Ajzele's profile on LinkedIn
  • Uwe Stoll: Thanks for your valuable advice. Furthermore, I found it be important to use the backend generated [...]
  • Danny: Ah. I think I figured it out.. But 1 thing.. How can I have it appear at just the home page and on t [...]
  • Danny: I've set everything up as instructed on this page, but it still doesn't show up on the front page... [...]
  • Chris: [code] true local [/code] [...]
  • Chris: Looks like the author forgot to include a pool to which the code comes from. local or community. [...]

Categories