Welcome Guest, Not a member yet? Register   Sign In
Using CodeIgniter with phpDesigner 8
#14

[eluser]RobertSF[/eluser]
[quote author="php_princess" date="1377303301"]
I'm confused if I truly have xdebug. I just did the following:

-Opened CodeIgniter's index.php in phpDesigner8
-HIt the Debug button (its right of Code button)
-Selection option that says Debug F9
-Got a prompt that says "Do you want to break on first line?"
-I clicked yes.
-It highlighted the first line of index.php in blue
[/quote]

Yes, xdebug is installed and working if it stopped on the first line. What happens is that certain code can break a debuggers control of execution. After xdebug stops at the first line of index.php, if you set some breakpoints in your own code and then let it rip until it hits them, it won't work. It disappears into la-la land, or behaves as you have described.

There are stretches of CodeIgniter code that can run without problem, and then there are certain points where you have to single-step in before you can run some more. Here are the three points that I have to execute single-step or it kills the debugging session. There may be other points in your case, depending on what you're doing, but try these first.

ci/index.php line 204:
Code:
require_once BASEPATH.'core/CodeIgniter.php';

core/CodeIgniter.php line 359:
Code:
call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2));

core/Loader.php line 299:
Code:
require_once($mod_path.'models/'.$path.$model.'.php');

Set breakpoints at those lines and then run. When execution reaches the breakpoint, single step in and run again to the next breakpoint. Continue until you're looking at your own code.

You also don't have to start xdebug from the very start of your application (though, of course, you'll always start at line one of index.php). If you append ?XDEBUG_SESSION_START (in caps) to a URL, that will make xdebug kick in if it's already listening. For this to work, you have to have query strings enabled in your config file. You can also put that xdebug query string in a form's action, like this:

Code:
action='base_url/method?XDEBUG_SESSION_START'

That way, debugging won't start until you submit that particular form.

I hope this helps. Debugging with a debugger is a real time-saver once you get it working!


Messages In This Thread
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-22-2013, 11:05 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-23-2013, 09:58 AM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-23-2013, 01:52 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-23-2013, 02:43 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-23-2013, 05:15 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-24-2013, 05:52 AM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-24-2013, 03:42 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-24-2013, 03:53 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-24-2013, 07:41 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-24-2013, 08:54 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-24-2013, 09:06 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-24-2013, 09:35 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 08-25-2013, 04:56 PM
Using CodeIgniter with phpDesigner 8 - by El Forum - 09-04-2013, 02:56 AM
Using CodeIgniter with phpDesigner 8 - by El Forum - 09-04-2013, 04:03 AM
Using CodeIgniter with phpDesigner 8 - by El Forum - 09-04-2013, 11:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB