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:
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:
Then:
-
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: If you are using Wamp, I assume you have that file in the Wamp folder like i did.
In File | Settings | Languages & Frameworks | PHP | Debug
make sure the Xdebug definitions are as following:
-
Go to Run | Edit Configurations and add a new PHP Web Page
configuration with the following definitions:
- define a localhost server if needed
- Start URL is the address of the page you would like to start the debugging.
Go to Run | Web Server Debug Validation and make sure the
debugger is configured properly:
-
And finally, start debugging:
- Press the Start Listening for PHP Debug Connections:
- Press the Debug button, or Shift + F9
Happy Debugging!
Top comments (0)