我有 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=