Reputation: 39
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?
Upvotes: 3
Views: 9482
Reputation: 911
Lots of answers out there for old versions. Very simple with Mamp 2.2 and PHPStorm 7.1 (OSX 10.9)
MAMP:
Edit the PHP.ini for the version you are using through MAMP to enable XDebug, just as Allen describes, removing the ';' in front of the zend_extension and add xdebug.remote_enable=1
PHP Storm:
Run->Edit Configurations
Add a new PHP Web Application
Configure a new Server, host is 'localhost' and port is '8888', and set the start URL (/myapp)
That's it, hit debug and you are good to go, that easy.
Upvotes: 0
Reputation: 4038
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
Start debugger
bookmarkletStart Listen PHP debug connections
iconFor details, here is the Jetbrains tutorial post.
Upvotes: 13