我们正在运行 Ubuntu Server 18.04.5。我刚刚从 PHP 7.2 升级到 7.4,因为 Wordpress 出现问题。我按照以下说明操作这里一切顺利。我现在想删除 7.2,但当我运行命令时,sudo apt purge '^php7.2*'
正则表达式不仅会选择 7.4 和 7.2,还会安装 PHP8。我已将输出粘贴在下面。我在实际发生任何事情之前就取消了。我做错了什么?
The following packages were automatically installed and are no longer required:
dbconfig-common dbconfig-mysql fonts-droid-fallback fonts-noto-mono ghostscript
gsfonts imagemagick-6-common javascript-common libcupsfilters1 libcupsimage2
libfftw3-double3 libgs9 libgs9-common libijs-0.35 libjbig2dec0 libjs-jquery
libjs-sphinxdoc libjs-underscore liblcms2-2 liblqr-1-0 libmagickcore-6.q16-3
libmagickwand-6.q16-3 libpaper-utils libpaper1 php-bz2 php-phpseclib php-tcpdf
php8.0-bz2 poppler-data ttf-dejavu-core
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libapache2-mod-php libapache2-mod-php8.0 libpcre16-3 libpcre3 libpcre3-dev
libpcre32-3 libpcrecpp0v5 php php-bz2 php-curl php-gd php-intl php-mbstring
php-mysql php-pear php-soap php-xml php-xmlrpc php-zip php8.0 php8.0-bz2
php8.0-cli php8.0-common php8.0-curl php8.0-gd php8.0-intl php8.0-mbstring
php8.0-mysql php8.0-opcache php8.0-readline php8.0-soap php8.0-xml php8.0-xmlrpc
php8.0-zip
The following packages will be REMOVED:
libapache2-mod-php7.2* libapache2-mod-php7.4* php7.2* php7.2-bz2* php7.2-cli*
php7.2-common* php7.2-curl* php7.2-gd* php7.2-intl* php7.2-json* php7.2-mbstring*
php7.2-mysql* php7.2-opcache* php7.2-readline* php7.2-soap* php7.2-xml*
php7.2-xmlrpc* php7.2-zip* php7.4* php7.4-bz2* php7.4-cli* php7.4-common*
php7.4-curl* php7.4-gd* php7.4-imagick* php7.4-intl* php7.4-json* php7.4-mbstring*
php7.4-mysql* php7.4-opcache* php7.4-readline* php7.4-soap* php7.4-xml*
php7.4-xmlrpc* php7.4-zip* phpmyadmin*
The following NEW packages will be installed:
libapache2-mod-php8.0 php8.0 php8.0-bz2 php8.0-cli php8.0-common php8.0-curl
php8.0-gd php8.0-intl php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-readline
php8.0-soap php8.0-xml php8.0-xmlrpc php8.0-zip
The following packages will be upgraded:
libapache2-mod-php libpcre16-3 libpcre3 libpcre3-dev libpcre32-3 libpcrecpp0v5 php
php-bz2 php-curl php-gd php-intl php-mbstring php-mysql php-pear php-soap php-xml
php-xmlrpc php-zip
18 upgraded, 16 newly installed, 36 to remove and 10 not upgraded.
Need to get 6,810 kB of archives.
After this operation, 44.9 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
答案1
我最终“解决”这个问题的方法是允许安装满足 APT 要求的 PHP8。由于 Apache 允许您使用 a2enmod 命令选择要使用的 PHP 版本,因此执行后sudo a2enmod php7.4
Wordpress 会保留在 7.4 上。似乎没有任何问题。`