我有 Ubuntu 16.04,并且运行了以下命令
sudo add-apt-repository ppa:ondrej/php
最终结果如下:
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmp94jbo60i/secring.gpg' created
gpg: keyring `/tmp/tmp94jbo60i/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp94jbo60i/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
然后我运行这个:
sudo apt-get update
该命令的结果是:
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Hit:4 https://esm.ubuntu.com/infra/ubuntu xenial-infra-security InRelease
Hit:5 https://esm.ubuntu.com/infra/ubuntu xenial-infra-updates InRelease
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Hit:7 http://ppa.launchpad.net/ondrej/apache2/ubuntu xenial InRelease
Hit:8 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
然后我运行此代码来安装 php8.0:
sudo apt install php8.0-fpm libapache2-mod-fcgid
它总是返回:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php8.0-fpm
E: Couldn't find any package by glob 'php8.0-fpm'
E: Couldn't find any package by regex 'php8.0-fpm'
如果有人知道并分享解决方案,我将不胜感激。
答案1
由于 php 5.something fpm 是核心 php 的一部分,而不是单独的包。因此,如果您已经安装了 php8.0,那么您只需启用它(可能,sudo a2enconf php8.0-fpm
但我只是在这里猜测)。
如果您查看所添加的存储库的包详细信息,您可以看到 php8.0 包中的内容: https://launchpad.net/~ondrej/+archive/ubuntu/php/+packages?field.name_filter=php8.0&field.status_filter=published&field.series_filter=