简体   繁体   English

无法将 Xdebug 与 Laradock 一起使用

[英]Unable to use Xdebug with Laradock

Tools: Laradock with nginx, php-fpm and MariaDB containers, PhpStorm, Xdebug and Windows 10.工具:带有 nginx、php-fpm 和 MariaDB 容器的 Laradock、PhpStorm、Xdebug 和 Windows 10。

Problem: Whenever I start listening for calls and refresh any page its just hangs, even if there is no breakpoints set on that page.问题:每当我开始监听呼叫并刷新任何页面时,它都会挂起,即使该页面上没有设置断点。 Xdebug starts a session in PhpStorm, but it shows empty. Xdebug 在 PhpStorm 中启动了一个 session,但它显示为空。

If I right click a file and start it with debugger I get:如果我右键单击一个文件并使用调试器启动它,我会得到:

[docker://laradock_php-fpm:latest/]:php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=host.docker.internal /opt/project/routes/web.php PHP Fatal error: Uncaught Error: Class 'Route' not found in /opt/project/routes/web.php:21 Stack trace: [docker://laradock_php-fpm:latest/]:php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=host.docker.internal /opt/project/routes/web .php PHP Fatal error: Uncaught Error: Class 'Route' not found in /opt/project/routes/web.php:21 Stack trace:

0 {main} thrown in /opt/project/routes/web.php on line 21在第 21 行的 /opt/project/routes/web.php 中抛出 0 {main}

Process finished with exit code 255进程以退出代码 255 结束

This is my configuration right now:这是我现在的配置:

在此处输入图像描述 在此处输入图像描述

Xdebug.ini both for php-fpm and workspace: Xdebug.ini 用于 php-fpm 和工作区:

在此处输入图像描述

Anyone can point me in the right path?任何人都可以指出我正确的道路吗?

Edit: I now get this error:编辑:我现在收到此错误:

Cannot accept external Xdebug connection: Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'无法接受外部 Xdebug 连接:无法评估表达式 'isset($_SERVER['PHP_IDE_CONFIG'])'

I think it may be related to the file mapping我认为这可能与文件映射有关

I needed to add the absolute path to the project in the laradock container: /var/www/nameoftheproject我需要在 laradock 容器中添加项目的绝对路径:/var/www/nameoftheproject

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM