Last updated June 14, 2016. Created on March 10, 2012.
Edited by KayUK, imadalin, Anonymous (not verified), akshayagarwal. Log in to edit this page.


This Article explains you how to configure your PHPStorm to work with your local installation of Drupal and debug using XDebug.
If you would like to know how install Drupal or Acquia drupal or XDebug please refer to the hundreds of articles already published.

Installing PHPStorm

  1. Download trial PHPstorm
  2. Install...

Create a Project

It is assumed you already have a full Drupal environment which includes: Apache, MySQL, PHP, Drupal and XDebug
So as a result we have two assumptions:

  • your local drupal site is at http://mylocalsite (usually its http://localhost);
  • your local drupal code is at c:\path\to\my\local\code
    which is also the DocumentRoot for mylocalsite vhost config in Apache.

So here is what you need to do:

  1. File --> New Project from Exisiting Files
  2. choose Web Server is installed locally, source files are located under its document root --> Next
  3. enter the path your local Drupal code c:\path\to\my\local\code
  4. Local Server:
    • Name: your project name should be fine
    • Web server root URL: should be http://mylocalsite:[port]
    • Web path for project root: leave blank. In Drupal projects the web path is the same as the path to the source code --> Finish

Set Up a Server

  1. Run --> Edit Configurations
  2. click on the yellow plus button --> PHP Web Application
  3. Name: your project's name
  4. Server:
    1. click on the button
    2. Name: your server name (any name)
    3. Host: mylocalsite (without the http://)
    4. Port: your mylocalsite port
    5. Debugger: Xdebug
    6. click OK
  5. in Server choose the server you just created
  6. Browser: your favorite browser where the site will be open
  7. So it should look something like this:

  8. Click OK
  9. Thats it!

    Now place some breakpoints and click on Debug (Shift + F9)

plus.png663 bytes
EditConfigurations.png57.09 KB
3dots.png551 bytes

Looking for support? Visit the forums, or join #drupal-support in IRC.


andypost’s picture

There was a similar post in russian

PS: we need ability to make link to translations|great-posts

raj8’s picture

I am trying to do the same, for debugging a drupal 7 project through phpstorm 7. But, I am unable to setup. I have my break-point on index.php but when I debug it never stops at the break-point.

I request you to upload a video or with screenshots to describe the process.

jeromewiley’s picture

When I click on Debug button, I immediately get a pop-up:

Edit Configuration
+Test runner
+Command line
etc, etc
(!) Error: interpreter is not specified or invalid --> (button) [Fix]

more buttons vvv
[Debug] [Cancel] [Apply] [Help]