IntelliJ IDEA 11.1 Web Help

10.0.2+
Some features described here are available in Ultimate edition only.

IntelliJ IDEA supports three main approaches to initiating a PHP debugging session:

During the debugging session on the local or remote server, the server side of the debugger tells IntelliJ IDEA the name of the currently processed file and the number of the line to be processed. IntelliJ IDEA opens the local copy of this file and indicates the line with the provided number. This behaviour is enabled by specifying correspondence between files and folders on the server and their local copies. This correspondence is called mapping.

When using Xdebug, you can also debug PHP applications in the multiuser mode via Xdebug proxy servers.

To debug a php application according to a configuration
  1. Define a debug configuration of the type PHP Web Application.
  2. Set the breakpoints, where necessary.
  3. Click the Debug button debug on the toolbar.
  4. Examine the application as soon as the debugger suspends on reaching the first breakpoint.
  5. To control the program execution manually, step through the code using menu commands or toolbar buttons.
  6. To have the program run automatically up to the next breakpoint, resume the session.
To enable starting and stopping a debugging session through control over the debugger cookie, do one of the following
  • Specify GET/POST or COOKIE parameters for Zend Debugger or for Xdebug manually.
  • Generate bookmarklets through which you will start/stop a debugging session by controlling the debugger cookie.
    1. Open the Project Settings and click PHP. Then click Debug under the PHP node.
    2. In the Debug page, that opens, click the Use debugger bookmarklets to initiate debugger from your favorite browser link.
    3. On the Zend Debugger & XDebug bookmarklets page that opens, check the debugging engine settings and click Generate. The bookmarks for listed debugging-related actions are generated.
    4. Add the generated links to the list of your bookmarks.
To debug a php application without a debug configuration
  1. Enable control over the debugger from the browser, if you have not done it yet.
  2. To prepare the IntelliJ IDEA for a debugging session,
    1. Set the breakpoints, where necessary.
    2. Toggle the Start Listen PHP Debug Connections button start_listening_php_debug_connections so it changes its color to green stop_listening_php_debug_connections. After that IntelliJ IDEA starts listening to the port of the debugging engine used in the current project. Ports for debuggers are set at the IntelliJ IDEA level in the Debug dialog box (File | Settings | PHP | Debug for Windows and Linux, IntelliJ IDEA | Preferences | PHP | Debug for Mac OS).
  3. Open the starting page of your application in the browser.
  4. To activate the debugging engine from the browser, choose the <debugging_tool> Start session bookmark.
  5. Re-load the current page (the starting page of the application).
  6. Switch to IntelliJ IDEA.
  7. Examine the application as soon as the debugger reaches the first breakpoint and suspends.
  8. To control the program execution manually, step through the code using menu commands or toolbar buttons.
  9. To have the program run automatically up to the next breakpoint, resume the session.

See Also

Procedures:

Reference:

External Links:

Web Resources: