【发布时间】:2020-10-19 20:20:27
【问题描述】:
我正在使用 xdebug 尝试 PhpStorm,但是当我尝试验证配置时,向我显示警告:未启用远程调试,如下图所示。同样的方式 phpinfo() 显示 xdebug.remote_enable 为 Off,当然 debug 也不起作用。
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"
【问题讨论】:
-
我认为远程端口有问题,你提到了9001,而phpstorm正在寻找9000,你可以更新并再次检查吗?
-
您必须正在编辑错误的 php.ini 文件.. 或者在单独的 .ini 文件中定义了 xdebug 设置(除了主文件之外还要进行解析)。检查
phpinfo()输出,第一个表:它包含该 PHP 安装使用的配置文件。 -
是的,你是对的。我在编辑错误的 php.ini。从 phpinfo() 加载的配置文件中显示了正确的配置文件。谢谢!