【发布时间】:2019-05-31 18:35:41
【问题描述】:
我使用的是 Ubuntu 17.10,一切正常。但是,在更新到 Ubuntu 版本 18.04 并进行全新安装后,我无法再让 Xdebug 正常工作。
我尝试实施我在 SO 或其他网站上找到的解决方案,但都没有帮助。
php -v
PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
这是我在 php.ini 中的配置
/etc/php/7.2/apache2/php.ini
(与 /etc/php/7.2/apache2/conf.d/20-xdebug.ini 文件相同)
[XDebug]
zend_extension ="/usr/lib/php/20170718/xdebug.so"
xdebug.profiler_enable =On
xdebug.auto_trace=On
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=90000
Xdebug Chrome 扩展 - ide 键选项
(我清理了之前属于 Eclipse 的 cookie)
PHPSTORM
phpinfo();的几行
PHP Version: 7.2.10-0ubuntu0.18.04.1
Loaded Configuration File: /etc/php/7.2/apache2/php.ini
Additional .ini files parsed: /etc/php/7.2/apache2/conf.d/20-xdebug.ini
--xdebug--
Version: 2.6.0
IDE Key: 1
xdebug.remote_enable: On
我的设置有什么问题?我能做些什么来解决它?
【问题讨论】:
-
“不工作”是什么意思。您可能想先花更多时间描述问题。
-
@Devon 这意味着什么都没有发生
-
这并没有描述问题。你在运行什么代码?你在哪里运行它?你在 phpstorm 中设置了什么调试配置?你是如何设置断点的?
-
@Devon 我正在运行一个 laravel 框架 v5.7,在 phpstorm 设置->lang&frameworks->php cli 添加,指定额外的 xdebug 路径.. chrome xdebug 扩展安装,为 phpstorm 配置。另外,我设置断点是什么意思,我没有得到这个问题?
-
我是 PhpStorm 团队的一员,实际上不建议使用 Run 配置进行 web 调试,因为每次都需要手动编辑 URL 很麻烦,而且你不能选择什么点您要开始调试会话。德文,我希望这听起来不粗鲁,你当然可以随心所欲。 @TeomanTıngır 通常,当您不了解调试会话发生的情况时,查看Xdebug remote log 会很有帮助。请进行设置。
标签: php apache phpstorm xdebug ubuntu-18.04