php - Xdebug 已安装,但 IDE 不听
问题描述
我正在做一个项目,我想使用 Xdebug。到目前为止,一切都很好。
但我没有让那该死的东西发挥作用,这让我(以及我的同事)感到压力很大
我正在使用 Laravel Homestead/Vagrant 和 PhpStorm 作为 IDE。Homestead VM 是一个 Ubuntu VM (18.04.1 LTS)
我为安装 Xdebug 所采取的步骤。
- 我必须在我的 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
- 我去过
File / Settings / Languages & Frameworks / PHP
这是我的配置文件
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 插件)
解决方案
推荐阅读
- reactjs - React 测试库不会导致 onClick 被调用
- r - 具有不同类的多个 value.var 的 dcast data.table
- r - 使用 R 中的特殊字符从 .txt 文件中读取数据帧
- django - Crispy 表单:将字段呈现为 HTML
- node.js - Prisma - 在更多条件下更新一个资源
- spring-boot - 为什么 Mockito.when(mockedService.someMethod(eq("String1")) 和 Mockito.when(mockedService.someMethod("String1)) 行为不同
- blazor-server-side - 为什么带有 FluentValidation 的 MudBlazor SelectList 会抛出“验证函数错误”
- javascript - 滚动时的粘性浮动 Div 元素
- java - Payara 4 到 Payara 5 迁移 - Json 问题
- python - 如何在matplotlib中将3d表面的痕迹可视化为线