views:

169

answers:

2

I have setup remote debugging in netbeans. It works except codeigniter only loads the default controller (home page). I have enabled query strings with

$config['enable_query_strings'] = TRUE;

The debugger opens up a page with the following url

http://blinkfilms.ben.dev/myid/tests?XDEBUG_SESSION_START=netbeans-xdebug

So codeigniter should fire up the controller in controllers/myid/tests.php

+1  A: 

Found the problem:

$config['uri_protocol'] = "PATH_INFO";

For the record the following works:

$config['uri_protocol'] = "AUTO";

$config['permitted_uri_chars'] = '';

$config['enable_query_strings'] = TRUE;
Keyo
That won't work in CodeIgniter 2.0 sadly. The best approach is to use parse_str($_SERVER['QUERY_STRING'], $_GET) in global code (hook preferably).
Phil Sturgeon
+1  A: 

Probably won't work in CI 2.0, but I managed to get it working in CI 1.7.2 with a hack.

Create a file in your application/libraries folder called "MY_Input.php" and add the following code:

function _sanitize_globals()
{
    if (isset($_GET['XDEBUG_SESSION_START']))
        $xdebug = $_GET['XDEBUG_SESSION_START'];

    parent::_sanitize_globals();

    if (isset($xdebug))
        $_GET['XDEBUG_SESSION_START'] = $xdebug;
}

Quick 'n dirty.. but works for me :) A pre-system hook might work as well with code like this, but I haven't tried that.

caseyamcl
PS >> This doesn't require you to set enable_query_strings to true, which I was trying to avoid.
caseyamcl