I am totally confused - How do I setup a debugger?
I am a (pretty) experienced PHP programmer, but I've never used a debugger or a full-featured IDE, mainly because I've tried many times to use debugger and I always failed with the setup. Now I've decided to start learning how to develop like a professional - use debuggers and an IDE. After some research I found PhpStorm as a good one, so I downloaded a trial.
Now I know the main concepts, but then I had to really understand how to debug. I saw that PhpStorm integrates with XDebug and Zend debugger, so firstly I've download XAMPP and tried to setup XDebug on it. Failed, with any tutorial on the internet. I've tried Zend Server (CE), and since it includes a debugger, it can be really easy. Installed successfully, but now I have to integrate it with PhpStorm. So what is the difference between PHP servers, interpreters, include paths, remote debug, and PHP script?
After playing with XAMPP, WAMP, LAMP, Zend Server, Zend Server CE, and the built-in PHP 5.4 webserver, I'm almost desperate, again.
I know I cannot call myself "experienced", but it's pointless to develop PHP code without an IDE, and it's pointless to use an IDE without it's exclusive features- like debugging.
Any link/explanation/help will be appreciated. Thank you!
请先登录再写评论。
Hi Nadav,
Start here: http://confluence.jetbrains.net/display/WI/Documentation
Also search this forum for "xdebug", "wamp" and similar keywords. You may find quite a few topics that may be useful to you:
Hi Andriy,
Thank you. I have successfully setup Zend Debugger, but through Zend Server CE. Do you think that's fine, or it is recommended to setup it on XAMPP or WAMP? I have succeeded in running zero-configuration debugging, and it works perfectly.
I just don't really understand what's the difference between Run and Debug, Both start the debugger.
Hi Nadav,
It's completely up to you -- all depends on your requirements and how close your dev environment should be compared to production one. I, for example, use IIS as web server, since most of the code will be run on IIS (although later some sites/scripts can run on Apache).
Most likely it's your settings (debugger part) as "Run" just opens page in browser (depends on type of Run/Debug configuration, of course) while "Debug" initiates debug session as well.
Since you are using "zero-configuration debugging", I think it's safe to assume that debugger is configured to start debug session for every requested page, hence you see no difference between Run and Debug.
Ok, Thanks. I used the boorkmarks to start/stop the debugger and now everything works perfectly. Thank you very much!
-Nadav
Used the zero-configuration debugging tutorial, and used Zend Server CE.