我想安装特定版本的 php,我写了这个命令sudo apt-get install php7.2
,它显示如下
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'php7.2-common' for regex 'php7.2'
Note, selecting 'php7.2-sodium' for regex 'php7.2'
Note, selecting 'libapache2-mod-php7.2' for regex 'php7.2'
Note, selecting 'php7.2-thrift' for regex 'php7.2'
0 upgraded, 0 newly installed, 0 to remove and 235 not upgraded.
在此之后,当我想知道 php 的版本时,我运行php -v
我收到以下错误
Command 'php' not found, but can be installed with: sudo apt install php7.4-cli # version 7.4.16-1ubuntu2.1, or sudo apt install php-cli # version 2:7.4+76ubuntu1