当xdebug加载时,CakePHP命令行不起作用

问题描述:

我试图在PHP 7.1.6中使用xdebug来解决CakePHP v3.3.6项目中失败的单元测试。当xdebug加载时,CakePHP命令行不起作用

[xdebug] 
xdebug.remote_enable = on 
xdebug.remote_host = 127.0.0.1 
xdebug.remote_port = 9000 
xdebug.remote_autostart = 1 
xdebug.profiler_enable = off 
xdebug.profiler_enable_trigger = off 
xdebug.profiler_output_name = cachegrind.out.%t.%p 
xdebug.profiler_output_dir = "c:/wamp/tmp" 
xdebug.show_local_vars=0 
xdebug.max_nesting_level=256 

PHP现在连接到我的XDebug客户端(VisualStudio的代码),但只要我跑PHPUnit的./vendor/phpunit/phpunit/phpunit或蛋糕控制台./bin/cake.php立即有一个例外:

我使用下面的设置来设置的XDebug

类型:灵气\国际\异常

消息: “包 '蛋糕' 与地方 'en_US' 未注册”。

我在网上看了一下,发现one other person encountering the same issue但他们最终的解决方案只是禁用xdebug,这不是我想要的。我想知道如何启用xdebug可以导致这个问题,以及如何解决它。

谢谢!

编辑:值得注意的我试图把禁用缓存在我的bootstrap.php

// Disable all cache reads, and cache writes. 
Cache::disable(); 

这并没有帮助以下。

我也有这个错误。我发现它与VS Code有关,因为我在Sublime中调试没有问题。

有点试验和错误之后,我发现,添加:

"ignore": [ 
    "**/vendor/**/*.php" 
] 

launch.json解决了这一问题。我不太清楚这背后的魔力,但现在我可以继续前进。

https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug