PhpStorm Debugging
Quick start
Install debugger
In order to proceed with any debugging scenarios, you should have a debugger installed in your PHP environment.
Recommended debugger
Start debugging!
Start here — that's the most popular debugging scenario.
Debugging PHP Web Application
Where do you want to debug?
Locally
Debugger and PhpStorm are running on the same machine
Remotely
Debugger is running on a remote environment (e.g. remote server, virtual machine)
Direct communication means that no firewall, router or ISP is blocking the connection from your remote server to the specific port on the local machine.
This can be verified by running telnet host 9000 (Xdebug) or telnet host 10137 (Zend Debugger) on the remote server (where host is the IP address of the local machine PhpStorm is running on) and checking that a connection is established.
You can use canyouseeme.org or a similar service to check for opened inbound ports.
Debugging PHP CLI Script
Where do you want to debug?
Locally
Debugger and PhpStorm are running on the same machine
Remotely
Debugger is running on a remote environment (e.g. remote server, virtual machine)
Debugging Features and Interface
Breakpoints
While debugging, we typically use breakpoints to pause the execution of our application at a specific line of code. PhpStorm provides different types of breakpoints, such as line breakpoints, temporary breakpoints, and more.
Variables Pane
In this pane we can see the variables that are in scope at the current breakpoint, e.g for a breakpoint inside a function body, the variables created within that function will be visible.
Stepping through Code
As soon as breakpoint is hit, you have a control over the program's execution. Each stepping action advances the execution point to the next location, such as step over, step into, step out, run to cursor, step filters, and more.
Debug Tool Window
Once the debugger is launched, PhpStorm shows the debug tool window. It consists of debugger toolbars, frames pane, variables pane, watches pane, and console tab.
Experience any Problems?
Check out a full troubleshooting guide for more information!
Troubleshooting PhpStorm Debugging
Advanced Debugging Scenarios
Debugging PHP Web Applications with Run/Debug Configurations
Simultaneous Debugging Sessions with PhpStorm
Multi-user Debugging in PhpStorm with Xdebug and DBGp Proxy
Related Tutorials
JavaScript Debugging
Should you still require assistance with debugging configuration, please report an issue to PhpStorm technical support.