views:

1371

answers:

3

Hello guys.

I can't use Xdebug to debug a application built with Code Igniter, but i can use it to debug any other PHP file as long it doesn't use the same Structure for url solving that Code Igniter uses.

Meaning: In a simple PHP file with no Code Igniter, when i use NetBeans debugging the browser goes to: http://localhost:86/index.php?XDEBUG_SESSION_START=netbeans-xdebug

Since no Code Igniter or other framework as been used, NetBeans can actually debug the PHP.


But when using Code Igniter when hit the debug button in NetBeans, and the browser goes to:

http://localhost:86/index.php?XDEBUG_SESSION_START=netbeans-xdebug

the root index.php where all happens in Code Igniter no luck, instead i get the standard CodeIgniter "404 Page not Found".

My guess its that due to the structure Segments that Code Igniter uses for url solving, xdebug can't debug nothing.

Example: example.com/class/function/ID

How can i make xdebug work with Code Igniter?

Thanks.

Using:

  • Windows 7 32 bits.
  • XAMPP version 1.7.3.
  • PHP 5.3.1
  • Xdebug v2.0.6-dev
+2  A: 

Looks like the same issue was solved here. Per that question's accepted answer, be sure you have the following set in your config file:

$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings'] = TRUE;
Colin
But isn't there a way to do it without enabling query strings, keeping the same Code Igniter segment structure? Thanks
Fábio Antunes
If a query string (such as ?XDEBUG_SESSION_START=netbeans-xdebug) is required, I would imagine you must configure CodeIgniter to allow them. Hope that helps.
Colin
A: 

I can't get it working either. Using Eclipse and have gone through the most part of the available tutorials online, but without any result. Just getting 404's at the debug or no debugging at all.

Industrial
+2  A: 

After a while of research and testing i came across this article.

http://brettic.us/2009/11/07/developing-php-on-a-mac-with-netbeans/

where it says and shows and to use the xdebug Firefox plugin with xDebug in your local server installation and NetBeans enabling you to debug your Code Igniter project without the need to turn on Query Strings in your Code Igniter config settings.

Really easy to use actually. Hope that helped others that were having the same problem.

Fábio Antunes
Will definitely check this out and give it a try. Thanks Fabio!
Industrial
I am thrilled to have the "easy Xdebug" Firefox add-in working on my Ubuntu LAMP. My problem was precisely as Fábio described -- NetBeans, xDebug and CodeIgniter not playing well together. Thanks!
Smandoli
@Smandoli: Glad it worked.
Fábio Antunes
I finally got it working. Woohoo! It was a matter of setting "xdebug.remote_autostart=0" and correcting IDE_KEY in the firefox plugin!
Industrial