DEV Community

Cover image for Installing Xdebug on PHPStorm for dummies
Ori Volfovitch
Ori Volfovitch

Posted on

Installing Xdebug on PHPStorm for dummies

When I was asked to install Xdebug on my environment at work, I found multiple guides on the web. None of them were exactly what I needed.
At my workplace, we use PHPStorm as an IDE, and our local environment is Wamp (the headline says for dummies).

So, after scavenging information from multiple guides, I finally got it to work, and wrote it in a document for my teammates.

Lucky for you, I like to share!

Step by step:

  1. Go to php.ini file, make sure that xdebug.remote_enable = 1.
    if you are not sure where is your php.ini file is, and you are using Wamp, you have shortcut from your taskbar:
    Alt Text
    Then:
    Alt Text

  2. In PHPStorm, go to File | Settings | Languages & Frameworks | PHP and
    choose:

    • PHP level => 5.5 in my case. if you are not what is your PHP version, echo phpinfo().
    • CLI interpreter => add a new interpreter from a Local Path with the following definitions: Alt Text If you are using Wamp, I assume you have that file in the Wamp folder like i did.
  3. In File | Settings | Languages & Frameworks | PHP | Debug
    make sure the Xdebug definitions are as following:
    Alt Text

  4. Go to Run | Edit Configurations and add a new PHP Web Page
    configuration with the following definitions:
    Alt Text

    • define a localhost server if needed
    • Start URL is the address of the page you would like to start the debugging.
  5. Go to Run | Web Server Debug Validation and make sure the
    debugger is configured properly:
    Alt Text

  6. And finally, start debugging:

    • Press the Start Listening for PHP Debug Connections: Alt Text
    • Press the Debug button, or Shift + F9 Alt Text

Happy Debugging!

Top comments (0)