phpxdebug

Why does Xdebug show different versions of PHP for `Run Time` and `Compile Time`?


I installed php-xdebug on my Debian 12 VM. When I run xdebug_info(), the PHP Build Configuration reports different versions of PHP for Run Time and Compile Time.

Xdebug Output:

PHP Xdebug Build Configuration

The Debian server is new, and has only had one version (8.3) of PHP installed using the deb.sury.org package.

I'm using the built-in PHP webserver. 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

The PHP version reported by php_info() is 8.3.12. There are no references to 8.3.6.

PHP Info Output:

PHP Info Configuration

PHP Info Variables

The Xdebug version is 3.3.2, which is the latest stable version.

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

I used this script that I wrote to install PHP, among other packages and tools. There isn't too much of anything else installed on the server.

PHP Install Script:

## 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 was manually installed later from package repository: 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) ...

Solution

  • Version (Compile Time) is the PHP version used to compile the xdebug extension and is not very useful, regardless of the PHP version you currently have installed.