Using CodeIgniter with phpDesigner 8 |
[eluser]php_princess[/eluser]
My configuration seems to have everything it requires: http://wiki.mpsoftware.dk/doku.php/home/...ith_xdebug Edit: I don't know what I did but I haven't seen the "unable to open PHP and xdebug" error for a little while. Now I'm consistently getting "Disallowed key characters." I Googled this and it seems to be a CodeIgniter issue. That's odd because I don't get that error on the remote host. An answer on stackoverflow is suggesting changing the libraries/Input.php file Shound like a good idea? http://stackoverflow.com/questions/41979...characters
[eluser]InsiteFX[/eluser]
Just a note, I get the same thing but thats after it runs to the end of the file! Make sure the the WinCacheGrind.exe file is in the PhpDesigner folder.
[eluser]php_princess[/eluser]
I've figured out a bit after fighting with this for days. I think some of the errors came from me debugging files that I shouldn't be debugging. For instance, I get the "Cannot find MY_Controller" error consistently when I try to debug a controller directly. I think I'm supposed to start with CI's index.php and feed it the controller name and other applicable arguments. The thing is, though, I think it's getting to the "Disallowed key characters" message before it ever makes it to the controller. Yesterday I debugged CI's index.php and just gave it auth as the argument. I don't think it ever made it to the auth controller. I saw the code go through like 10 files (CodeIgniter.php, common.php, constants.php, etc.), but never auth.php *scratches chin* I wonder what I'm doing wrong. --- And yep I put WinCacheGrind.exe in the phpDesigner folder. It's in the root of it.
[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!
[eluser]php_princess[/eluser]
When I debug am I supposed to pick the "Debug" option or "Debug with Parameters" option? If so, would I give it the parameters auth/signup if I wanted to load the auth controller and use the signup method?
[eluser]RobertSF[/eluser]
[quote author="php_princess" date="1378292588"]When I debug am I supposed to pick the "Debug" option or "Debug with Parameters" option? If so, would I give it the parameters auth/signup if I wanted to load the auth controller and use the signup method?[/quote] I don't know because I don't have PHP Designer, but you could try. The way that should definitely work is to use the query string. Make sure xdebug is listening. According to PHP Designer's wiki, "You can start, restart or stop the Xdebug server on the Debug menu, select Xdebug IDE server." Then, in your browser, enter Code: http://your_base_url/auth/signup?XDEBUG_SESSION_START Xdebug will still start at line 1 of CI's index.php, though, because it has no way of distinguishing between your code and Code Igniter's. This post here claims to have found a way for xdebug to survive redirects by setting "xdebug.remote_autostart=1" in php.ini. http://stackoverflow.com/questions/17089...r-redirect If you haven't worked with a debugger before, consider practicing with a php script that you execute directly. |
Welcome Guest, Not a member yet? Register Sign In |