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.

How to debug CI source code with NetBeans. ? thanks!

July 19, 2009 6:45am

Subscribe [6]
  • #1 / Jul 19, 2009 6:45am

    Nano HE

    9 posts

    Hi,

    Good day.

    My NetBeans enviroment based windowns system.
    The tool worked very well for normal PHP source code.

    i want to debug CI code with my NetBeans.

    I set my system project properties -> run configuration -> Project URL: http://localhost/data/index.php/welcome/
    And i linked the CI system folder as the NetBeans Project root directory.
    When i strike F6 (Run). It worked well.

    Then i set breakpoint at the welcome controller source code file welcome.php.
    BreakPoint located here :

    $this->load->view('index');

    When i strike Ctrl + F5 (Debug Project)
    It failed to Go to the welcome.php file and also it didnot stop at the breakpoint.

    IE url link to
    http://localhost/data/index.php/welcome/?XDEBUG_SESSION_START=netbeans-xdebug
    Show the following information.
    404 Page Not Found
    The page you requested was not found.

    i am appreciated any help.

    BR
    Nano

  • #2 / Jul 20, 2009 3:27am

    Bogdan Tanase

    56 posts

    try enabling query strings in config.php file from CI, it might get you a little further.

    $config['enable_query_strings']=TRUE;

    BTW, the only decent debugging I’ve seen for PHP is the one from Zend Studio. It has a browser plugin which communicates with Zend Studio so you can break the script exactly where you got the problem.

    It works very simple:
    1. set break point in the suspected code
    2. run the application and go to the page you wish to debug (let’s say a form or something).
    3. right click browser window, select “debug next page”
    4. Submit the form. And that’s all. The debugger will start.

    It also doesn’t uses query strings so it works really nice with CI.

    I’m interested if anyone found a similar free solution to do useful debugging in PHP.

  • #3 / Jul 20, 2009 8:35am

    Francis Robert

    3 posts

    I have found the following but haven’t tried it yet:
    http://stackoverflow.com/questions/978325/enablequerystrings-not-working

    $config['uri_protocol'] = "PATH_INFO";
    $config['enable_query_strings'] = TRUE;
  • #4 / Jul 21, 2009 8:31am

    Nano HE

    9 posts

    Hey,

    Guys thank you!

    feedback my test result.

    Test result : pass!

    the following snippets from config.php

    // $config['uri_protocol']    = "AUTO";
    $config['uri_protocol']    = "PATH_INFO";        // Work very well for NetBeans Debug Test
    // $config['uri_protocol']    = "QUERY_STRING";    // Can't Work for NetBeans Debug Test
    // $config['uri_protocol']    = "REQUEST_URI";    // Can't Work for NetBeans Debug Test
    $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';    // Work very well for NetBeans Debug Test
    // $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?';  // that means the character of ? is optional

    Thanks a lot!

  • #5 / Feb 11, 2010 2:20am

    I’m interested if anyone found a similar free solution to do useful debugging in PHP.

    You can download just the debugger & toolbar from Zend.com (free registration required). Although for the debugger I suggest using Zend Server Community Edition (Windows, Mac or Linux) as it comes with it and everything is highly optimized. I actually use for my production system as well since the compile is more optimized then the one you’d get using apt-get.

  • #6 / Feb 28, 2010 10:21am

    theshiftexchange

    211 posts

    ok - i have netbeans 6.8 + php5 + codeignitor all working.

    I’ve discovered one thing: I had to leave “index.php” in my URL and remove my .htaccess rewrite script to get it to work.

    I’m posting this here in case people search for a solution like i did smile

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

ExpressionEngine News!

#eecms, #events, #releases