Setting up XDebug on MAMP PRO with PHPStorm and Virtual Hosts
mamp, phpstorm, xdebug
Solution
I was having the same issue getting XDebug to work with MAMP Pro and PHPStorm but I finally figured it out. Here is what I did:
Edit the `php.ini` file by launching MAMP and then going to File->Edit Template->PHP->your PHP version and add:
`[xdebug] zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" xdebug.remote_enable=1`
Add bookmarklets for `Start debugger`, `Stop debugger`, and `Debug this page` from this bookmarklet generator
- Set a break point in PHPStorm that you want to trigger
- Click the `Start debugger` bookmarklet
- In PHPStorm, click on the `Start Listen PHP debug connections` icon
- Load the page that will trigger the breakpoint and that should do it
For details, here is the Jetbrains tutorial post.
Problem
I'm new to debugging and finally found some time to play with it. But I can't get the debugger to work in PHPStorm (2.1). I'm on a Mac (Snow Leopard) and using MAMP PRO (2.0.1). XDebug is installed (default MAMP - 2.1.0) and active. One of the tutorials I've followed is this one: http://blog.jetbrains.com/webide/2011/02/zero-configuration-debugging-with-xdebug-and-phpstorm-2-0/ And I used this tool for generating bookmarks: http://www.jetbrains.com/phpstorm/marklets/ In PHPStorm I click on the "Start Listen PHP debug connections" button and in the web browser I use the link "Start debugger". Then I refresh the webpage and expect something to happen in PHPStorm. But nothing happens. Something should happen, right? I think it probably has something to do with the virtual hosts (created in MAMP PRO) I'm using. When I'm working on a project I'm using URLS like dev.companyname.com Can it run with different virtual hosts or do I have to use 'localhost'? How can I get this thing to work?