- Define a debug configuration of the type PHP Web Application.
- Set the breakpoints, where necessary.
-
Click the Debug button
on the toolbar.
- Examine the application as soon as the debugger suspends on reaching the first breakpoint.
- To control the program execution manually, step through the code using menu commands or toolbar buttons.
- To have the program run automatically up to the next breakpoint, resume the session.
-
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.
- Open the Project Settings and click PHP. Then click Debug under the PHP node.
- In the Debug page, that opens, click the Use debugger bookmarklets to initiate debugger from your favorite browser link.
-
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.
- Add the generated links to the list of your bookmarks.
- Enable control over the debugger from the browser, if you have not done it yet.
-
To prepare the IntelliJ IDEA for a debugging session,
- Set the breakpoints, where necessary.
-
Toggle the Start Listen PHP Debug Connections button
so it changes its color to green
.
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 (
for Windows and Linux, for Mac OS).
- Open the starting page of your application in the browser.
- To activate the debugging engine from the browser, choose the <debugging_tool> Start session bookmark.
- Re-load the current page (the starting page of the application).
- Switch to IntelliJ IDEA.
- Examine the application as soon as the debugger reaches the first breakpoint and suspends.
- To control the program execution manually, step through the code using menu commands or toolbar buttons.
- To have the program run automatically up to the next breakpoint, resume the session.
