Phpstorm does not see xdebug but it is installed

前端 未结 5 795
甜味超标
甜味超标 2021-02-04 09:51

PhpStorm cannot see xdebug but it is installed. In my browser xdebug works fine. Where is the problem?

The error:

Connection with \'xdebug\' was n

5条回答
  •  梦毁少年i
    2021-02-04 10:22

    First, are you using MAMP (free) or MAMP Pro?

    Turns out there is a difference between the php.ini file you edit from MAMP and the php.ini file that PhpStorm uses in the interpreter.

    The MAMP Pro php.ini file resides in /Library/Application Support/appsolute/MAMP PRO/conf/php.ini and doesn't have a PHP installation (which PhpStorm needs when setting the interpreter). If you run phpinfo(); this is the file you will see data from.

    When you set PhpStorm to the necessary location here /Applications/MAMP/bin/php/php5.4.x/bin it looks at the php.ini file there, not the one that MAMP Pro uses (above). So if you want PhpStorm to see the debugger, you need to add the code to that php.ini file.

    PhpStorm Interpreter Settings

    For help setting up the interpreter for MAMP and PhpStorm refer to the documentation here

    HELPFUL HINT: When checking to see if xdebug is installed make sure to run the --version command in terminal from the MAMP php location. Otherwise you'll end up seeing the default OSX PHP info which wouldn't have xdebug installed by default.

    Example: run this in the PhpStorm terminal to see if it works /Applications/Mamp/bin/php/php5.4.4/bin/php --version

提交回复
热议问题