在Debian 11上安装PHP 7.4(使用操作系统标准安装)

首先

在Debian 11中默认安装了PHP。
原文:有关PHP和PHP-FPM的各种安装方法和EOL的总结。

日志

安装

# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

# apt update;apt install -y php
... 略

不同的确认方式

# which php
/usr/bin/php

# php -v
PHP 7.4.21 (cli) (built: Jul  2 2021 03:59:48) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.21, Copyright (c), by Zend Technologies

# php -i | grep php.ini
Configuration File (php.ini) Path => /etc/php/7.4/cli
Loaded Configuration File => /etc/php/7.4/cli/php.ini

# apt show php
Package: php
Version: 2:7.4+76
Priority: optional
Section: php
Source: php-defaults (76)
Maintainer: Debian PHP Maintainers <team+pkg-php@tracker.debian.org>
Installed-Size: 13.3 kB
Depends: php7.4
Download-Size: 6340 B
APT-Manual-Installed: yes
APT-Sources: http://deb.debian.org/debian bullseye/main amd64 Packages
Description: server-side, HTML-embedded scripting language (default)