Welcome Guest, Not a member yet? Register   Sign In
how to use neatbeans for php to debug codeigniter
#11

[eluser]bretticus[/eluser]
I'm using a Mac with MAMP, but my settings are the following in my php.ini file:

Code:
; Xdebug config for Mac OS X and NetBeans IDE
zend_extension=/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20050922/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

Under preferences for xdebug helper (the firefox addon and it should be noted that instructions for enabling this with windows are part of the preferences dialogue window) I have "netbeans-xdebug" under Xdebug.idekey. I choose "Debug Project" from netbeans (Not run.) I choose "Serverside PHP." That opens my browser to to the index.php page (that doesn't work.) At that point, my continue button is green. I press that and then I'm all ready to go when I load an actual page from my project.

Hope this helps.
#12

[eluser]neomech[/eluser]
I'll look into my configuration settings a little more. Thanks for the help.
#13

[eluser]mikaelmorvan[/eluser]
Hi,

Thanks for the advice, I succeeded in debugging my CI application.
One more tip: use the full query string format:
ie my url is like that:

http://mysite.com/index.php?c=myControle...ans-xdebug

Everything is working properly. I use these url in my Ajax call and I can debug my php.

Thanks again
Mikaƫl Morvan
#14

[eluser]bretticus[/eluser]
Just for the heck of it I made a video on screenr to demonstrate this. Keep in mind I already have the xdebugger extension installed, my php.ini file edited for it (the firefox plugin has instructions as you'll see.) This is hard to hear for some reason (I talk quietly and my mic gain needs to be turned up I guess.) It's alot of ho-hum as it was completely unscripted and off-the-cuff. Sorry.

Otherwise, it just shows it working which is all we really care about. Smile

Watch it right here.
#15

[eluser]_krc_[/eluser]
[quote author="bretticus" date="1251968230"]It will open up your browser to the funky URL (index.php?XDEBUG_SESSION_START=netbeans-xdebug) that will not work. The trick is clicking the continue button (or f5) to get that page/tab through to the "disallowed characters" error page.[/quote]

Ok I made all settings as You said, but what happens if this continue buttton is disabled Smile ?

Xdebug is running in netbeans correctlym but when I click "Debug main project" nothing really happens, it turns into debugging state but it doeasn't catch the first line, the new page with funky url shows up, but it doesn't show blank page instead it already shows the error.
#16

[eluser]theshiftexchange[/eluser]
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
#17

[eluser]Unknown[/eluser]
After pulling out hair all afternoon I found this thread and got it working in just a few minutes. Thanks, all!

[quote author="theshiftexchange" date="1267387469"]
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.[/quote]

I solved that by adding an exemption to .htaccess:

RewriteCond $1 !^(index\.php|images|XDEBUG_SESSION_START=netbeans-xdebug|robots\.txt)
#18

[eluser]PeteSig[/eluser]
Hi Guys

I'm new to the forum & code igniter.
I'm trying to get debugging working with netbeans.

I've installed xdebug & had it working with straight php, but can't seem to get it with ci.

When I try to debug the project, I'm presented with a 'Project Properties' window within which I need to set the Project URL (http://localhost/ci pete ecom/), Index File (index.php); and Arguments (XDEBUG_SESSION_START=netbeans-xdebug); - which then gives me a complete url of:
http://localhost/ci pete ecom/index.php?XDEBUG_SESSION_START=netbeans-xdebug

But net beans tells me: 'Project URL is not valid' and so doesn't run the debug session!!!???!

Anyone got any ideas?

Cheers

Pete

-----------------------------------------------------------------------------
EDIT:

Its okay guys I got it working.
I changed the url entry of the project properties to:
"http://localhost/ci pete ecom/" - replaced spaces with 'percent sign 20'
[which is not being shown up here in forum post - pesky spaces / html !]

and bingo!

So not a ci specific thing - just user error (as usual) :o)
#19

[eluser]silentday[/eluser]
I did a writeup on how to get Netbeans and Xdebug working with CI 2.0. See if this fixes your issues:

http://diceandbrackets.com/brackets/code...eans-6-9-1
#20

[eluser]dwlamb[/eluser]
I can't say I am pulling out my hair for I am now bald but I sure would like to get this working.

I followed the steps outlined in the post by Bretticus but think I am missing something.

I downloaded and installed the xdebug plug-in for Firefox. If I understand Bretticus' steps exactly they are basically
- start a debug session in Netbeans
- switch url's in Firefox by opening a new url/tab and closing the first url/tab
- have a break point set and do a Run to Cursor

The last part is where I am not succeeding. CI does not run to cursor and I am still getting the message as if I am running http://<siteurl>/index.php




Theme © iAndrew 2016 - Forum software by © MyBB