Debugging and Profiling

Visual Debugger

PhpStorm provides numerous options for debugging your PHP code. Inspect context-relevant local variables and user-defined watches, including arrays and complex objects, and edit values on the fly. Set up remote debugging for your server, evaluate an expression in runtime, debug a page in multiple sessions simultaneously, keep a debugging session alive while moving between pages, and more.

Zero-Configuration Debugging

With zero-configuration debugging, you do not need to create any debug configuration. Instead, you open the starting page of your PHP application in the browser manually, and then activate the debugging engine from the browser, while PhpStorm listens to incoming debugger connections. Both Xdebug and Zend Debugger are supported.

Read more about zero-configuration debugging with PhpStorm.

And when (in some cases) you still need to configure debugging manually, read this article: How to configure debugging in PhpStorm.

Debugger Configuration Validation

There is nothing more frustrating than not getting PHP Debugging to work because of some configuration error in php.ini.

When configuring the PHP interpreter for project, PhpStorm will inform you if a debugger is installed and will yield the Xdebug or Zend Debugger version. From PHP Servers Settings window, you can validate the debugger setup: you can test the remote environment on which you want to use the debugger and validate the debugger configuration. PhpStorm will tell you if anything is missing, and how to fix that.

Inline Debugger for PHP

With an inline debugger for PHP, all live debugging data are shown directly in the editor, with variable values integrated into the editor interface. Variable values can be viewed in the source code, right next to their usages.

XDebug for REST Client

PhpStorm has a button in the REST Client that sends the HTTP request with the right cookie automatically set. Thus debugging of RESTful Web Service can be done right from within the REST Client, without leaving the IDE.

Debugging with Smart Step Into

This debugging feature allows you to choose the function to step into while debugging. This functionality also works with dynamic function calls.

Zend Server Integration

PHP debugging and profiling sessions can be activated from Z-Ray and Zend Server interface to take action in PhpStorm.

Interactive Debug Console for PHP (REPL)

Interactive debug console (REPL) allows you to alter variables, call PHP functions, and define additional functions – all on the fly within the debug session.

Profiler Integration

You can profile your applications right from the IDE with either Xdebug or Zend Debugger. PhpStorm provides a visual representation of profiling data generated by Xdebug or Zend Debugger. You can select several snapshots at a time and collect the aggregated profiling information. Observe an aggregated report and jump from the execution statistics directly to the function in your PHP code.