美文网首页CWIKIUS
PHP Windows 下 XAMPP 的 xdebug 配置

PHP Windows 下 XAMPP 的 xdebug 配置

作者: HoneyMoose | 来源:发表于2023-03-10 01:18 被阅读0次

    在 IntelliJ 下调试 PHP 的断点有时候还是比较困惑的。

    同时根据你使用的 xdebug 配置也有关系。

    xdebug 2.x

    下面的配置是 xdebug Version 2 的配置,如果你使用 xdebug 3.x 版本的话,配置是不同的。

    [XDebug]zend_extension="php_xdebug.dll"xdebug.remote_autostart=1xdebug.profiler_append=0xdebug.profiler_enable=0xdebug.profiler_enable_trigger=0xdebug.profiler_output_dir="/xampp/tmp"xdebug.remote_enable=1xdebug.remote_handler="dbgp"xdebug.remote_host="127.0.0.1"xdebug.remote_log="/xampp/tmp/xdebug.txt"xdebug.remote_port=9000xdebug.trace_output_dir="/xampp/tmp"xdebug.remote_cookie_expire_time=36000

    xdebug 3.x

    下面的配置是 xdebug 3.x 版本的配置,这个版本的配置已经有了不少的修改。

    如果直接使用 xdebug 2.x 版本的配置的话,可能会遇到 IntelliJ 断点不停的问题。

    [XDebug]zend_extension="xdebug"xdebug.mode=debugxdebug.client_host=127.0.0.1xdebug.client_port="9003"xdebug.start_with_request=yes

    改变

    从 xdebug 3.x 开始,默认的调试端口使用了 9003 的端口,这个与 xdebug 2.x 使用的 9000 端口是不一样的。

    这个需要注意。

    另外:xdebug.start_with_request=yes参数必须要添加,否则 IntelliJ 的断点不停。

    官方的这篇文章:Configure Xdebug | IntelliJ IDEA Documentation非常值得参考,最好仔细阅读下。

    https://www.ossez.com/t/php-windows-xampp-xdebug/14334

    相关文章

      网友评论

        本文标题:PHP Windows 下 XAMPP 的 xdebug 配置

        本文链接:https://www.haomeiwen.com/subject/mjnxldtx.html