Php Debugger in NuSphere PhpED
Every program no matter how well written can have bugs or other defects – there’s no exception to this rule, including in your PHP scripts or any other software program that you develop. Debugging is the process of finding the bugs so they can be fixed and the PHP Debugger is the best tool for helping you find the bugs fast and eliminate them from your PHP programs. You can setup remote debugging in PhpED with the help of debug PHP Settings Wizard and DBG Wizard. For information about supported platforms and how to install PHP Debugger modules please check debugging PHP on various platforms page.
How to debug a PHP script
There are many techniques used for PHP debugging, varying from desperate PHP code inspection to angry keyboard slamming. A less extreme and more useful approach would be to use print statements and logging embedded in your PHP code, printing out variable values throughout various stages of the program execution.
This approach works well in general, however suffers from several drawbacks, for example:
- It requires significant additional coding effort, which ironically can introduce even more bugs into your php script
- Debugging of PHP with print statements is a highly repetitive process – it’s impossible for a developer to lock onto a problematic region of code while printing everything and everywhere
- Introduction of so many print statements and conditional can affect the performance of your PHP application.
PhpED’s PHP Debugger provides a powerful and easy way to simplify PHP debugging because it gives you complete visibility and control over the execution of PHP scripts and doesn’t require that you make any changes to your PHP code. With PhpED’s PHP Debugger you can: |
Step through lines of php code
Inspect Call-Stack
Inspect any variable or class in PHP
Assign a different value to PHP variables in the script
Set break points to interrupt php script execution
Make break points act based on various conditions
Call a PHP function on the fly and inspect the results
Support for remote PHP debugging
All major server platforms are supported
Parallel debug sessions
Just in Time debugging
Change Execution point on the fly
Global breakpoints with conditions
Secure debugging: IP security and traffic encryption
Advanced php profiler
How to use PhpED’s PHP Debugger
PhpED’s PHP Debugger will let you step through your php code, control the execution flow, see the current values of all variables in the script as well as content of the arrays and classes at each stage or even assign different values to the variables on the fly and do all of it without making any changes to php application. This brief tutorial will help you to learn how to use PhpED’s PHP Debugger.
The Call Stack window displays the function calls that brought you to the current script location. The top of the Call Stack window lists the last function called by your script. Below this is the listing for the previously called function. The listing continues, with the first function called in your script located at the bottom of the list. The Call Stack window also shows the names of member functions (or methods). Each member function is prefixed with the name of the class that defines the function.
Set/toggle break points to interrupt php script execution
PhpED allows you to easily set and toggle breakpoints anywhere in your PHP code. The lines of code highlighted in blue represent breakpoints. The line in red shows the PHP script current state. You can set/toggle breakpoints from a toolbar, by typing the “F5″ key, or by clicking on the red dot to the left of the line of code. |
![]() |
![]() ![]() |
In this tutorial you learned about the many features of the PHP Debugger and how to use them to quickly find and eliminate bugs from your PHP scripts. You can watch a live demonstration of using the PHP debugger and advanced remote PHP debugging from our video tutorial library. Additional technical information is available on the NuSphere Forum. Download a free trial of our PHP Debugger today!