Debian 11 ,已经更新到最新
写法 1:apt install -y php php-fpm ...... The following additional packages will be installed: libsodium23 php-common php7.4 php7.4-cli php7.4-common php7.4-fpm php7.4-json php7.4-opcache php7.4-readline psmisc Suggested packages: php-pear The following NEW packages will be installed: libsodium23 php php-common php-fpm php7.4 php7.4-cli php7.4-common php7.4-fpm php7.4-json php7.4-opcache php7.4-readline psmisc 0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
对比写法 2:apt install -y php ...... The following additional packages will be installed: apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.4 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 libsodium23 php-common php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline psmisc ssl-cert Suggested packages: apache2-doc apache2-suexec-pristine | apache2-suexec-custom php-pear The following NEW packages will be installed: apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.4 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 libsodium23 php php-common php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline psmisc ssl-cert 0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
我觉得奇怪的是:
写法 1 apt install -y php php-fpm ,不会安装 apache2.
而写法 2 apt install -y php 则会安装 apache2.
难道
apt install -y php php-fpm
不等于
apt install -y php + apt install -y php-fpm
?
1
eason1874 2022-12-17 17:56:30 +08:00
确实不一样,我也遇到过,同样一行,有时候后面的不会安装,有时候又会安装。我不知道打断的逻辑是什么,很少用,没细究
|
2
yaoyao1128 2022-12-17 17:56:38 +08:00 via iPhone 1
https://packages.ubuntu.com/bionic-updates/php7.2
你不指定默认用 libapache2-mod-php7.2 你置顶 fpm 了就变成 fpm 了 这和分不分开写没啥关系 |
3
LIPiston 2022-12-17 17:57:31 +08:00 via Android
apt 不应该得换行输入吗(虽然这是我的习惯
|
4
adoal 2022-12-17 18:16:32 +08:00 4
php-7.4 依赖[libapache2-mod-php7.4, php7.4-fpm, php7.4-cgi]之一,如果你在装 php7.4 的时候没同时指定这三个包之一,并且这三个包之一也没安装过,那 apt 会挑选一个“最合适的”来安装,这个最合适,默认是 libapache2-mod-php7.4 。如果你同时指定 php7.4-fpm ,条件满足了,自然不会再给你安装 libapache2-mod-php7.4 。
|
5
liaohongxing 2022-12-17 19:33:49 +08:00
php 两种组合 nginx+php-fpm , apache+mod-php 。默认给你装 apache 版本
只装 php-fpm 就是 nginx 组合 |
6
debuggerx 2022-12-17 20:56:36 +08:00 via Android
如果我没搞错
apt install -y php php-fpm 其实和 apt install -y php-fpm 效果一样 所以有时很讨厌某些教程和文档里啪啪啪写一堆依赖的,完全没有必要 |