Part II First Debug Session
After we installed xdebug in Part I of this post , we now want to test our local debugging.Prerequisits
Installed IIS or apache, php7, xdebugInstall needed chrome xtensions
Chrome developed some useful browserextensions to make things easier for us.Let´s use this nice extensions.
The first extension is "jetbrains-ide-support"
You can install it here https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji
You can install it here https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc
If you click on it, a menue shows you your options
Let´s add some phpcode to test the debugger.
Add following code to a new phpstorm project:
Now we can start watching the code. Place some breakpoints somewhere in your code an connect the watcher
- Activate the watcher by clicking the "telephone" Icon in the top right
- Set some breakpoints like the following
You can step-in , step-over your breakpoints and you can directly see what values your variables are, without to use var_dump() and die();
Great Fun!
Keine Kommentare:
Kommentar veröffentlichen