setup xdebug in PHPStorm

Install xdebug on the server

Installing Xdebug on the server is not in the scope of this article. You can find related articles here:

Configure xdebug in phpstorm’s settings

Open the phpstorm Settings window and go to PHP -> Debug

Apply the settings as shown in the image below.
Beware: when you don’t want the debugging to break on the first line (for testing whether debugging works), remove the check mark in front of the option ‘Force break at the first line when no path mapping specified’

Screen Shot 2013-06-13 at 5.31.44 PM

Create a debug-server

The debug-server is the server where your webapplication code resides. From the menu, choose Run -> Edit Configurations.


Start listening for incoming debug sessions in phpstorm

In order to receive incoming debug sessions from the browser in phpstorm, you have to set phpstorm into the ‘listening’ mode.
To achieve this, click on the phone icon phpstorm-listening-icon as shown in the image below.


Enable debugging in Chrome

Install the Chrome extension ‘Xdebug helper which makes it easier for you start your debugging. For FireFox, use the plugin ‘Easy Xdebug‘.

After the extension is installed and you restarted your browser, visit your project webpage and click on the little bug-icon and choose option ‘Debug‘.

Then refresh your page and phpstorm will receive the debug-session and will start debugging!




Leave a Reply

Your email address will not be published. Required fields are marked *