首页 > 解决方案 > PhpStorm 无法识别 xdebug.remote_enable

问题描述

我正在使用 xdebug 尝试 PhpStorm,但是当我尝试验证配置时,向我显示警告:未启用远程调试,如下图所示。以同样的方式 phpinfo() 将 xdebug.remote_enable 显示为 Off,当然,调试也不起作用。

php.ini xdebug 配置:

[xdebug]

zend_extension = /usr/lib/php/20180731/xdebug.so

xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp/xdebug/"
xdebug.remote_host = "localhost"
xdebug.remote_port=9000
xdebug.idekey="PHPSTORM"

在此处输入图像描述

标签: phpstormxdebug

解决方案


您必须编辑错误的 php.ini 文件.. 或者在单独的 .ini 文件中定义了 Xdebug 设置(除了主文件之外还要对其进行解析)。

在 Linux 和 Mac 上,CLI 和 Web 服务器有不同的 php.ini 是很常见的。

检查phpinfo()输出,上表:它将显示该 PHP 安装使用的所有配置文件。


推荐阅读