我已遵循以下步骤...
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.4 php7.4-common php7.4-cli
输出是...
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.4 is already the newest version (7.4.13-1+ubuntu18.04.1+deb.sury.org+1).
php7.4-cli is already the newest version (7.4.13-1+ubuntu18.04.1+deb.sury.org+1).
php7.4-common is already the newest version (7.4.13-1+ubuntu18.04.1+deb.sury.org+1).
...
该怎么办?在 phpinfo() 中,我的版本是 7.0。我的 cli 版本是 7.2。
更新:
# update-alternatives --list php
/usr/bin/php.default
/usr/bin/php7.0
/usr/bin/php7.1
/usr/bin/php7.2
/usr/bin/php7.3
/usr/bin/php7.4
答案1
除了我在问题中提到的步骤之外,这些看起来是我从 php7.0 升级到 php7.4 所需的步骤......
update-alternatives --set php /usr/bin/php7.4
a2dismod php7.0
a2enmod php7.4
systemctl restart apache2