ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Debugging Project Built in CodeIgniter

March 16, 2011 12:35pm

Subscribe [3]
  • #1 / Mar 16, 2011 12:35pm

    justmelat

    20 posts

    Hello:

    I inherited a codeigniter app, that was created for our production and development environments, long story short, the user is able to auto create their own url, so for example if the company is “companyx” they enter in ‘companyx’ and click save, then they can go to the url “company.myproject.com” or if the company’s name is gaming, the enter it into the system, save it and the url is now “gaming.myproject.com”. That works perfectly.  All clients are using the same framework. 

    The problem started last week, there is an archive page that won’t open for a particular client.  Tried the sites for the other 20 clients and the archive link works, opens all the projects that they have marked as archived.

    So with this one client that’s having the issue-  We “assume” there is some odd data in their request db table that is preventing this page from opening.  [it is a completely blank page, no code when you do view source.] A query runs at the beginning of the controller to determine what projects are in archive status.

    For various reasons that i wont’ go into, I can’t debug directly on the stg server, so I download everything, code, db, all of it, and set it up on my local machine, the thing is, I can’t figure out what the url would be for my local machine.  I have to put that url into the debugger to kick it off.

    For my other codeigniter projects, the url is http://localhost/newCI for example

    If i want to open gaming.myproject.com from my local machine, how do i do it?  Or is there a way to go automatically go thru the mysql database to and verify that all all the field values are legit for this client?

    Help please!! aNd THank you!!

  • #2 / Mar 16, 2011 1:20pm

    IgnitedCoder

    60 posts

    You can do this using virtual host settings in apache..

    if you are using XAMPP, then add a directive to apache for your domain.

    http://httpd.apache.org/docs/2.0/vhosts/name-based.html

    Also for better debugging, install firebug and firephp for firefox. Google or check the forums on howto setup firephp on Codeigniter. I use it as follows once setup.

    $this->load->library('firephp');
    
    function loadme(){
       $this->firephp->log($var);
    }

    //this gets logged in the firebug window via firephp lib.

     

    Hope this helps some…

  • #3 / Mar 16, 2011 2:40pm

    justmelat

    20 posts

    Actually I got Firephp up and running.  It is really cool, but the problem is, since the page dies immediately, you can’t see any detailed info and I really think there is something funky in one of the database fields making it crap out.  I need the debugger so I can see the values that are being pass from the database.

  • #4 / Mar 17, 2011 2:31am

    Matt Stein

    110 posts

    I could be way off with this suggestion, but I found Webgrind to be pretty useful after the moderate struggle to get it working properly with MAMP Pro.

    http://code.google.com/p/webgrind/
    http://www.mamp.info/en/index.html

  • #5 / Mar 17, 2011 3:01am

    justmelat

    20 posts

    Thanks Matt

    I am open to anything right now.  I wouldn’t have thought it would be so difficult to one, debug and then debug codeigniter. 

    Thanks again.

  • #6 / Mar 17, 2011 4:49am

    InsiteFX

    6819 posts

    Make sure you have all the ERROR Reporting turned on!

    You may need to edit your php.in file.

    Check CodeIgniters index.php and make sure its on.

    InsiteFX

  • #7 / Mar 20, 2011 11:13pm

    justmelat

    20 posts

    I have turned very type of error reporting on.  This is what is in my error log now[this is just a snipped of the code, the “Model Class Initialized” goes on forever.] What can I do to see exactly what is wrong.  Help please.

    DEBUG - 2011-03-20 17:53:07—> Language file loaded: language/english/labels_lang.php
    DEBUG - 2011-03-20 17:53:07—> Language file loaded: language/english/lookup_lang.php
    DEBUG - 2011-03-20 17:53:07—> Language file loaded: language/english/emailmsg_lang.php
    DEBUG - 2011-03-20 17:53:07—> Database Driver Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Session Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Helper loaded: string_helper
    DEBUG - 2011-03-20 17:53:07—> Session routines successfully run
    DEBUG - 2011-03-20 17:53:07—> Helper loaded: form_helper
    DEBUG - 2011-03-20 17:53:07—> Form Validation Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Controller Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Helper loaded: date_helper
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Helper loaded: file_helper
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07—> Model Class Initialized
    DEBUG - 2011-03-20 17:53:07

  • #8 / Mar 21, 2011 1:42am

    justmelat

    20 posts

    Finally I figured it out:
    ini_set(Memory_limit, 32M)

    changed it to 128M

    the page works!!!!!

  • #9 / Mar 21, 2011 2:45pm

    Matt Stein

    110 posts

    I’m glad you got it working—I was just going to ask if it was more of a server issue than an app issue. It seems like something could need some optimization if this is on a test server and you’re blowing through the memory limit! Good luck!

  • #10 / Mar 21, 2011 4:02pm

    justmelat

    20 posts

    I tell you, this has been two weeks of agony.  I can’t believe it was the memory.  Actually this is the production server that is having the issue.  And this one particular client just has tons of data, so something will have to be done because they will chew through this 128M within a few months.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases