Working with the Debugger
The purpose of this tutorial is to teach you how to debug files and applications both remotely and locally in order to gain maximum efficiency and accuracy from your files and projects.
| |
| |
| |
|
|
|
|
The Zend Debugger can detect and diagnose errors in PHP code situated locally or on remote servers. The debugger allows you to control the execution of your program by setting breakpoints, suspending launched programs, stepping through your code, and examining the contents of variables.
Debugging should be used at stages where your scripts and applications are formed sufficiently to be tried and tested.
The Zend Debugger has two main features:
Debugging PHP files (PHP Scripts) from your workspace
Debugging files, applications and projects (PHP Web Pages) on your server.
Files on your workspace can be debugged locally using PDT's internal debugger.
|
|
|
This procedure demonstrates how to debug a file locally:
The debugging process will currently have stopped where your first <?php label appears.
|
|
PDT also allows you to debug applications, projects or files that are already on the server. Using the debugging process, you can also create an application in PDT and publish it to the server before debugging.
Note:
Your server must be running the Zend Debugger in order
for remote debugging capabilities to function.
The Zend Debugger comes bundled with Zend Core and Zend Platform, but can
also be downloaded as a separate component from http://downloads.zend.com/pdt/server-debugger.
|
|
|
This procedure demonstrates how to debug applications on a server:
<html> <body> <form action="welcome.php" method="post"> Name: <input type="text" name="name" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> </body> </html>
<html> <body> Welcome <?php echo $_POST["name"]; ?>.<br /> You are <?php echo $_POST["age"]; ?> years old. </body> </html>
|
|
|
|
|
Related Links: Debugging a PHP Script Locally Debugging a PHP Script |
|
|