首页 > 解决方案 > Xdebug 在 Ubuntu 18.04、PhpStorm、Zend Framework 3 上不工作 [不在断点处停止]

问题描述

我将 Zend Framework 3 与 PhpStorm 一起使用,我在 Ubuntu 18.04 上设置了 LAMP。

调试代码时,我在Chrome浏览器中打开调试图标[扩展],然后在PhpStorm中打开开始监听,然后我在页面加载的主页控制器方法处设置断点,然后我刷新页面以检查它是否停止断点。

我不确定我在设置中错过了什么,无法调试代码。任何帮助深表感谢。

etc/php/7.2/mods-available/xdebug.ini

xdebug.show_error_trace = 1
zend_extension=/usr/lib/php/20170718/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9001
xdebug.idekey = PHPSTORM
xdebug.remote_connect_back=1

etc/php/7.2/apache2/php.ini

[xdebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1

PHP版本详情:

shoebaamir123@ubuntu:~$ 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

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

标签: phpubuntuzend-frameworkphpstormxdebug

解决方案


Select "Remote Web Server" in the "Web Server Debug Validation" window and select there a server you created earlier as per my comment.


推荐阅读