Search code examples
macosphpstormxdebug

Enabling xdebug with phpstorm on mac OSX El Capitan


Before upgrading my macbook to El Capitan I had a sweet setup of Phpstorm 9, php 5.6 (via homebrew), xdebug (via homebrew).

For the last month or so, however, I have been breakin my head, trying to figure out how to make that setup work again.

I would appreciate any ideas you guys might have.

Thanks, Eyal

P.S. Here are my settings:

xdebug version and ide key xdebug version and ide key

xdebug remote settings xdebug remote settings

xdebug session cookie xdebug session cookie

xdebug port in phpstorm xdebug port in phpstorm

PHP configuration in phpstorm PHP configuration in phpstorm

Debug validation in phpstorm Debug validation in phpstorm

xdebug log

Log opened at 2015-11-19 22:33:49
I: Checking remote connect back address.
I: Remote address found, connecting to 127.0.0.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/eyalsh/Sites/test/index.php" language="PHP" protocol_version="1.0" appid="73266" idekey="PHPSTORM"><engine version="2.3.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2015 by Derick Rethans]]></copyright></init>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>

Log closed at 2015-11-19 22:33:49

Solution

  • Based on the provided info: please change xdebug port (in both php.ini and PhpStorm) to some another port (e.g. 9001) and verify that it is not occupied before doing that using the same sudo lsof -nP -iTCP -sTCP:LISTEN command.

    Right now there seems to be a conflict with php-fpm (both programs using the same ports).

    P.S. You may need to restart your web server to see those changes picked up from php.ini.