Search code examples
phpphpstormxdebug

xdebug 2 with PhpStorm setup error


I have been dealing with an unexpected error when trying to setup xdebug 2 with PhpStorm (2016.2.2). It says:

Connection with 'xdebug 2.5.0rc1' was not established. Validate installation.

I decided to ask for help because I cannot solve this error for 3 days already and I have tried everything I could.

These are the setup steps that I did:

  • pasted my phpinfo here (https://xdebug.org/wizard.php) and downloaded the recommended php_xdebug.dll (php_xdebug-2.5.0rc1-5.5-vc11-nts-x86_64).

  • copied php.ini file into bin\php\php5.6.0 and added these lines of code:

  • [Xdebug]
    zend_extension = C:\MAMP\bin\php\php5.6.0\ext\php_xdebug-2.5.0rc1-5.6-vc11.dll
    xdebug.default_enable=1
    xdebug.remote_enable=1
    xdebug.idekey=PHPSTORM
    xdebug.remote_port = 80
    xdebug.profiler_enable=1

  • Installed "JetBrains IDE Support" and "Xdebug helper" extensions for Chrome browser.

Sometimes I manage to debug (I guess) without an error but I get an error on browser which says "No direct script access allowed".

I am on Windows 10 x64 running MAMP 3.2.2 with php 5.6.0. Don't know what more details I can provide right now but it looks enough.


Solution

  • The problem that I had was on the other laptop that I use. Both of them use the same settings (win10, MAMP 3.2.2). On my second laptop (the one I am currently typing from) this is php.ini settings:

    PHP version: 5.6.0 PHP CLI: C:\MAMP\bin\php\php5.6.0\php.exe PHP CGI: C:\MAMP\bin\php\php5.6.0\php-cgi.exe Loaded Configuration File: C:\MAMP\bin\php\php5.6.0\php.ini Debugger extension: xdebug 2.4.1

    It uses xdebug 2.4.1 and I dont get the error on this laptop. I will try to get the same xdebug version to my first laptop and see if it works.

    And this is the only command I added to php.ini on the second laptop (xdebug functioning) "zend_extension = C:\MAMP\bin\php\php5.6.0\ext\php_xdebug-2.4.1-5.6-vc11.dll" . Does it even make sense that without extra Xdebug settings it could even run?