php - PhpStorm 和 Xdebug 的调试问题
问题描述
我正在尝试使用 Xdebug 在 PhpStorm v2019.1.2 中调试 Symfony 4 项目。问题是,每次我启动调试会话时,它都会中断(没有断点)bin/console.php (line 9)
:
if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL;
}
然后在vendor/symfony/web-server-bundle/Resources/router.php (line 25)
:
if (ini_get('auto_prepend_file') && !in_array(realpath(ini_get('auto_prepend_file')), get_included_files(), true)) {
require ini_get('auto_prepend_file');
}
在实际输入我的代码并点击我设置的断点之前。
如何修复/防止这种行为?
这是我的 PHP 版本:
PHP 7.3.1(cli)(构建:2019 年 1 月 9 日 22:22:34)(NTS MSVC15(Visual C++ 2017)x64)
版权所有 (c) 1997-2018 PHP 集团
Zend Engine v3.3.1,版权所有 (c) 1998-2018 Zend Technologies
使用 Xdebug v2.7.2,版权所有 (c) 2002-2019,作者 Derick Rethans
这是我的php.ini
xdebug 部分:
[XDEBUG]
zend_extension = "C:\Program Files\PHP\v7.3\ext\php_xdebug-2.7.2-7.3-vc15-nts-x86_64.dll"
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_cookie_expire_time = 3600
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_log=path_to_log/xdebug.log
xdebug.scream = 0
解决方案
推荐阅读
- prometheus - Prometheus query.lookback-delta 推荐值
- variables - 如何使用 terrafom 创建文件并将变量包含为文字?
- linux - watchman 使 fsnotify 虚假地检测文件更改
- ruby-on-rails - Rails:在 Rails 中添加表情符号
- ruby-on-rails - 如何在 options_for_select 中添加国家标志
- android - 菜单不根据导航控制器更新
- get - 空手道 - 当我使用 get 调用运行基本功能时,我在调用 get 的行上得到空手道异常作为实例
- oracle - 从 Oracle APEX 公共页面获取用户信息?
- javascript - 如何在字符串中找到整个子字符串?
- java - 无法在 JBoss EAP 7.2 中添加 SQL Server 数据源