PHP Xdebug

安装&启用 Xdebug

  1. 执行 php -i,获取安装的 php 信息
  2. 将第一步的结果贴入 xdebug 安装向导(Xdebug: Support — Tailored Installation Instructions)中,点击分析;
  3. 根据分析生成的指示,按步骤安装 Xdebug
  4. 安装完成后,配置启用 xdebug,在 99-xdebug.ini 中添加
    xdebug.mode=debug
    xdebug.start_with_request=yes
    xdebug.client_host=127.0.0.1
    xdebug.client_port=9003
    xdebug.idekey=PHPSTORM

浏览器安装 Xdebug 插件

Browser debugging extensions | PhpStorm Documentation

开始调试

浏览器插件开启 Debug,PHPStorm 开启监听即可

多版本 PHP 都需要单独编译安装

例如,默认 php 版本为最新 8.2.x,需要为 7.4 版本安装 xdebug。

大体步骤一直,有以下 2 个地方需要注意:

  1. 获取 phpinfo,可使用绝对路径执行 php -i
    /opt/homebrew/Cellar/php@7.4/7.4.33_3/bin/php -i

  2. 执行 ./configure 时要指定 php-config
    ./configure --with-php-config=/opt/homebrew/Cellar/php@7.4/7.4.33_3/bin/php-config

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
下一篇