【发布时间】:2018-08-18 15:50:53
【问题描述】:
信息:
- Docker 版本 (
$ docker --version):Docker 版本 18.06.0-ce,构建 0ffa825 - Laradock 提交 (
$ git rev-parse HEAD): 8180804ae - 系统信息(Mac、PC、Linux):macOs HighSierra 10.13.6
问题:
无法让 Xdebug 工作。
预期行为:
应该在断点处停止
相关代码:
laradock/.env
PHP_FPM_INSTALL_XDEBUG=true
WORKSPACE_INSTALL_XDEBUG=true
php-fpm/xdebug.ini的内容:
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.cli_color=1
xdebug.profiler_enable=0
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=172.16.3.97
xdebug.idekey=PHPSTORM
workspace/xdebug.ini 与 php-fpm 文件夹中的内容相同
【问题讨论】:
-
好吧,我从来没有那样做,但我遵循这些配置,jetbrains 所说的jetbrains.com/help/phpstorm/configuring-xdebug.html .. 它总是对我有用.. 它说在 php.ini 文件中添加上述行而不是在 xdebug .ini 文件..
-
1) Xdebug 日志要说什么? 2)
remote_host的 IP 地址是否正确?很多时候不是。尝试使用 Docker-special 主机名。 3)您在 Mac 上 .. 这意味着您可能在 Mac 上安装了 php-fpm .. 它也使用 9000 端口。将 xdebug 端口(在 php.ini 和 PhpStorm 中)更改为另一个(例如 9001 - 典型选择)。附言xdebug 是必须的——在某些情况下它可以立即给出答案或很好的提示(如果你知道如何阅读) -
关于 remote_host @LazyOne 的第一个提示很好!我刚刚在本教程中找到了解决方案:medium.com/full-stack-development/… 它终于可以工作了,是的,
remote_host很糟糕。由于“从 Docker 18.03 起,我们的建议是连接到特殊的 DNS 名称 host.docker.internal,它解析为主机使用的内部 IP 地址。”感谢您光临!
标签: laravel phpstorm xdebug laradock