首页 > 解决方案 > Xdebug 已安装,但 IDE 不听

问题描述

我正在做一个项目,我想使用 Xdebug。到目前为止,一切都很好。

但我没有让那该死的东西发挥作用,这让我(以及我的同事)感到压力很大

我正在使用 Laravel Homestead/Vagrant 和 PhpStorm 作为 IDE。Homestead VM 是一个 Ubuntu VM (18.04.1 LTS)

我为安装 Xdebug 所采取的步骤。

  1. 我必须在我的 Vagrant VM 上安装 xdebug,它也会在您启动 PHP 并用它编译时加载。

php --ini

...
/etc/php/7.2/cli/conf.d/20-sysvshm.ini,
/etc/php/7.2/cli/conf.d/20-tokenizer.ini,
/etc/php/7.2/cli/conf.d/20-wddx.ini,
> /etc/php/7.2/cli/conf.d/20-xdebug.ini, <
/etc/php/7.2/cli/conf.d/20-xmlreader.ini,
/etc/php/7.2/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.2/cli/conf.d/20-xsl.ini,
/etc/php/7.2/cli/conf.d/20-zip.ini,
/etc/php/7.2/cli/conf.d/25-memcached.ini,
...

php -v

PHP 7.2.13-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Dec  7 2018 08:07:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.13-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
    with blackfire v1.24.0~linux-x64-non_zts72, https://blackfire.io, by Blackfire
  1. 我去过File / Settings / Languages & Frameworks / PHP

这是我的 CLI 解释器的设置 设置

这是Debug的设置 调试

这是我的配置文件

zend_extension=/usr/lib/php/20170718/xdebug.so
xdebug.idekey="PHPSTORM"
xdebug.remote_enable=1
xdebug.default_enable=1
xdebug.remote_connect_back=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.max_nesting_level=300
xdebug.scream=0
xdebug.cli_color=1
xdebug.show_local_vars=1

如何解决当我尝试访问我的网站时,调试器无法工作的问题(PhpStorm 正在监听传入的连接,我正在使用用于 Xdebug 的 Firefox 插件)

标签: phplaravelphpstormxdebughomestead

解决方案


推荐阅读