PHP Debugger
The internal PHP Debugger is a suit of tools for validating code locally before
uploading to a web server.
Before running Debugger, you should configure it in the Preferences menu:
-
Select Tools-->Preferences-->Debugger
-
In the left grid choose Debug item and click General property
-
In the right grid set appropriate values for the following properties:
-
Virtual folder - path to project virtual folder
-
Virtual host URL - virtual folder URL
-
Path to php.ini - path to the php.ini file
-
Server - Apache version running on your computer.
Select it from the dropdown list displaying all Apache versions installed on your machine.
Tools used during debugging:
1. Breakpoints
Breakpoint is a marker that stops execution of the application at the line in which it is placed.
To add breakpoint:
- Click dark grey area next to necessary line of code or place a pointer on it and move to
Debug|Add/Remove Breakpoint (or click red bubble-shaped button on the Debugger toolbar).
-
At the left of the line red bubble-shaped marker will appear
The same procedures are used for removing breakpoints.
2. Tooltips
This feature allows reviewing variables values on the fly when breakpoint is reached.
To review value:
- Place the pointer over the variable
- The value will be highlighted in a tooltip box
3. Locals control
Locals control displays both Global and Local variables, their values and type.
4. Watch control
In the
Watch window you can place variables, objects and expressions you want to monitor while debugging
There are two ways for adding watches:
-
Place pointer on necessary element, from the mouse right click menu select Add watch (Shift+F8)
-
Copy-Past element name into the Name column
To delete element from the
Watch dialog, select necessary one and press
Delete key
or use
Delete option from the mouse right-click menu.
5. Call stack control
Call Stack window contains all functions called during debugging.
To jump to declaration of a function, double click line with a function name in the
Call Stack window.
6. URL debugging
This ability enables you to debug url.
To start debugging:
- Move to Debug|Debug url or press F8
- In the appearing URL Dialog specify path in the URL field
7. Handling debugging process
You can handle debugging process from
Debugger menu
or using
Debugger toolbar