[Solved] Debugging PHP Code - PhpStorm, Xdebug, WAMP, CodeIgniter
Hi guys, I'm finding Debugger Impossible to Setup in PHPStorm, and I'm only trying to use it locally because the features I would like to use are; "Watch" and "Break Points".
Followed instructions (for Zend Debugger) in help, and all I get are more problems. Seriously seems like I'm going backwards with your help F1 gizmo.
Tried with new Zend Server to help get it working, can't work out how to get around issues.
Is there a video to show me someone setting up and testing this working from scratch?
- Can I just use XDebug instead of Zend Debugger (and be able to use Watch and Breakpoint?)
- Note: XDebug is setup and working on my local server
- Is there a video for me to follow?
- Does it work with MVC and URL Rewrites? (I do not want any extra url params entered)
- I'm using CodeIgniter PHP framework (index.php is not displayed in url, special characters are not allowed for XSS prevention)
- PHP Info shows Zend Debugger running?
- Does anybody have a CodeIgniter app working with this ZendDebugger, Watch, Breakpoints in PHP Storm? :-/
?:|
Visual Studio .net sooo simple.
My friend says that Eclipse has debugging functionality and works easy... why is this so hard here.
Cheers,
Chris
Please sign in to leave a comment.
Hi Chris,
Have you looked at these articles? I had no issues configuring it.
Make sure that zend debugger is configured properly (port number in PhpStorm matches zend debugger settings etc) + make sure that no other IDE is listening on the same port.
As for the questions:
P.S.
I suggest you start with brand new very simple project first.
Once you make debugger work there -- only then move to the real (more complex) project -- this will ensure that debugging works and should allow you to understand how it works in PhpStorm (and if there are issue with debugging complex project, it would be just a matter of some additional settings rather than possible "this product is crap/too complicated because it does not work for me" statements -- works for other people).
Hi,
I read the help section about debugging and http://confluence.jetbrains.net/display/WI/Zero-Configuration+debugging+with+PhpStorm+2.0 but I'm still having troubles. I think the phpstorm IDE for remote debugging is very difficult to set up.
I have this page:
11_page.png
then click on Debug this page.
Here are some snapshots of some of my settings and mapped paths:
http://tutorialref.com/phpstorm/
Hi,
I read the help section about debugging and http://confluence.jetbrains.net/display/WI/Zero-Configuration+debugging+with+PhpStorm+2.0 but I'm still having troubles. I think the phpstorm IDE for remote debugging is very difficult to set up.
1) I have this page:
http://tutorialref.com/phpstorm/11_page.png
then click on Debug this page bookmarklet.
The page refreshes but nothing happens in the IDE.
See this page:
http://tutorialref.com/phpstorm/ide.png
I have a breakpoint at line 5. From here an ajax is made and the file "11_modCheckGrantor.php" should be called and I have another breakpoint in this file. But the IDE does nothing.
2) Secondly, I then tried just using SHIFT+F9 to start the debug on my already set up 11_page.php.
The Chrome browser opens to this page:
http://dyi.ultratrust.com/form/11_page.php?XDEBUG_SESSION_START=18089
But nothing stops at the breakpoints. I have a breakpoint on line 5 of 11_page.php
Here is a snapshot of my 11_page.php Web Application settings:
http://tutorialref.com/phpstorm/11_page_php_web_application_settings.png
I notice the that Red button (for CTRL+F2) is on so I can stop the process. It does seem like the IDE is waiting for something but I don't know how to stop at the breakpoints. Is my mapping wrong?
Here are some snapshots of some of my settings and mapped paths:
http://tutorialref.com/phpstorm/
What am I doing wrong here?
Thanks,
Victor
---
I think the IDE is a very good IDE but having a thorough step-by-step tutorial with snapshots like this page: http://confluence.jetbrains.net/display/WI/Zero-Configuration+debugging+with+PhpStorm+2.0
would be very helpful to people like me and others. It seems like this page though is missing a lot of other steps before it.
---
Adding this update here to help others... and attached a couple of files.
Status: So far so good
I did what you suggested.
Next I will try this with a Codeigniter page, see what happens. B-)
Attachment(s):
example-debugging-with-phpstorm-xdebug-breakpoint-watch-variable.png
php-ini-xdebug-settings.png
Status: Solved! The PHP debugger is working :)
Notes:
I am attaching a lot of files in here to allow others to setup same and try to get to same results.
Thank You Bazzik!
Attachment(s):
phpstorm-debug-php-debug-xdebug-proxy.png
phpstorm-debug-php-servers.png
phpstorm-debug-php-server-settings.png
phpstorm-debug-php-settings.png
bookmarklets-used-xdebug.png
... and a couple more images. B-)
Attachment(s):
phpstorm-bookmarklet-generator-xdebug-IDE-Key-used.png
phpstorm-debug-buttons-I-used-with-codeigniter.png
phpstorm-debug-php-debug-settings.png
Hi Chris,
Glad you worked that out.
Few comments (based on screenshots):
Hey Bazzik
1. Yes, figured that. Did not touch proxy, just put there for completion. For others to see that it's default.
2. That's a good tip, thanks. I should have looked more thoroughly on that list. However, note, I'm using the [Debug Listener]... I did not need to configure anything. To me that's easier. I just go to any page I want. I have heaps of pages, 100 pages or so, I don't want to configure anything special - just debug output + watch.
Note: :8} I was only using xdebug out direct to screen and firedebug. :O These both make the code dirty, and it's about time I do it properly with on the fly debugging with break points :8}