为什么 XDebug 在“运行时”和“编译时”显示不同版本的 PHP?

问题描述 投票:0回答:1

我在 Debian 12 VM 上安装了

php-xdebug
。当我运行
xdebug_info()
时,PHP 构建配置会报告
Run Time
Compile Time
的不同 PHP 版本。

  • 版本(运行时间)=
    8.3.12
  • 版本(编译时间)=
    8.3.6

X调试输出:

PHP XDebug Build Configuration

Debian 服务器是新的,并且仅使用

8.3
软件包安装了 PHP 的一个版本 (
deb.sury.org
)。

我正在使用内置的 PHP 网络服务器。

php -S 0.0.0.0:8888

php -v
PHP 8.3.12 (cli) (built: Sep 27 2024 04:03:53) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.12, Copyright (c), by Zend Technologies
    with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans

php_info()
报告的PHP版本是
8.3.12
。没有提及
8.3.6

PHP 信息输出:

PHP Info Configuration

PHP Info Variables

XDebug版本是

3.3.2
,这是最新的稳定版本。

php -i | grep Xdebug
    with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans

我使用了我编写的这个脚本来安装 PHP 以及其他软件包和工具。服务器上没有安装太多其他东西。

PHP 安装脚本:

## Setup PHP Repo
echo "\e[47m\e[31mInstall PHP source repository...\e[0m"
curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
dpkg -i /tmp/debsuryorg-archive-keyring.deb
sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt-get update

## Install PHP and Extensions
# FPM and CLI are installed first to remove Apache dependency
# Thanks https://askubuntu.com/users/583418/dan-delaney
# https://askubuntu.com/a/1357414
echo "\e[47m\e[31mInstalling PHP 8.3 FPM and CLI...\e[0m"
apt-get -y install php8.3-fpm php8.3-cli
echo "\e[47m\e[31mInstalling PHP 8.3...\e[0m"
apt-get -y install php8.3
echo "\e[47m\e[31mInstalling PHP 8.3 Extensions...\e[0m"
apt-get -y install php8.3-common php8.3-curl php8.3-mbstring php8.3-sqlite3 php8.3-xml php8.3-zip

XDebug 是稍后从软件包存储库手动安装的:

apt install php-xdebug

sudo apt install php-xdebug
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  php8.3-xdebug
The following NEW packages will be installed:
  php-xdebug php8.3-xdebug
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 628 kB of archives.
After this operation, 2,022 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://packages.sury.org/php bookworm/main amd64 php8.3-xdebug amd64 3.3.2-1+0~20240420.60+debian12~1.gbp3869a8 [622 kB]
Get:2 https://packages.sury.org/php bookworm/main amd64 php-xdebug amd64 3.3.2-1+0~20240420.60+debian12~1.gbp3869a8 [5,512 B]
Fetched 628 kB in 1s (852 kB/s)        
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.)
debconf: falling back to frontend: Readline
Selecting previously unselected package php8.3-xdebug.
(Reading database ... 32960 files and directories currently installed.)
Preparing to unpack .../php8.3-xdebug_3.3.2-1+0~20240420.60+debian12~1.gbp3869a8_amd64.deb ...
Unpacking php8.3-xdebug (3.3.2-1+0~20240420.60+debian12~1.gbp3869a8) ...
Selecting previously unselected package php-xdebug.
Preparing to unpack .../php-xdebug_3.3.2-1+0~20240420.60+debian12~1.gbp3869a8_amd64.deb ...
Unpacking php-xdebug (3.3.2-1+0~20240420.60+debian12~1.gbp3869a8) ...
Setting up php8.3-xdebug (3.3.2-1+0~20240420.60+debian12~1.gbp3869a8) ...
Setting up php-xdebug (3.3.2-1+0~20240420.60+debian12~1.gbp3869a8) ...
Processing triggers for php8.3-cli (8.3.12-1+0~20240927.43+debian12~1.gbpad3b8c) ...
Processing triggers for php8.3-fpm (8.3.12-1+0~20240927.43+debian12~1.gbpad3b8c) ...
php xdebug
1个回答
0
投票

版本(编译时)是用于编译 xdebug 扩展的 PHP 版本,无论您当前安装的 PHP 版本如何,都不是很有用。

© www.soinside.com 2019 - 2024. All rights reserved.