我正在嘗試從 php7.4 更新到 php8.0
我應用了以下步驟
sudo apt update
sudo apt upgrade
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
apt-get install php8.0 php8.0-bz2 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-fpm php8.0-gd php8.0-intl php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-pspell php8.0-readline php8.0-xml php8.0-zip php8.0-imagick
但我得到了錯誤
php8.0-fpm.service - The PHP 8.0 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php8.0-fpm.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2022-03-25 19:49:43 03; 10ms ago
Docs: man:php-fpm8.0(8)
Process: 6949 ExecStopPost=/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/8.0/fpm/pool.d/www.conf 80 (code=exited, status=0/SUCCESS)
Process: 6941 ExecStart=/usr/sbin/php-fpm8.0 --nodaemonize --fpm-config /etc/php/8.0/fpm/php-fpm.conf (code=exited, status=78)
Main PID: 6941 (code=exited, status=78)
Mar 25 19:48:53 server.aaaaaa.com systemd[1]: Starting The PHP 8.0 FastCGI Process Manager...
Mar 25 19:48:53 server.aaaaaa.com php-fpm8.0[6224]: [25-Mar-2022 19:48:53] ERROR: failed to open configuration file '/etc/php/8.0/fpm/php-fpm.conf': No such file or directory (2)
Mar 25 19:48:53 server.aaaaaa.com php-fpm8.0[6224]: [25-Mar-2022 19:48:53] ERROR: failed to load configuration file '/etc/php/8.0/fpm/php-fpm.conf'
Mar 25 19:48:53 server.aaaaaa.com php-fpm8.0[6224]: [25-Mar-2022 19:48:53] ERROR: FPM initialization failed
Mar 25 19:48:53 server.aaaaaa.com systemd[1]: php8.0-fpm.service: Main process exited, code=exited, status=78/n/a
Mar 25 19:48:53 server.aaaaaa.com systemd[1]: php8.0-fpm.service: Failed with result 'exit-code'.
Mar 25 19:48:53 server.aaaaaa.com systemd[1]: Failed to start The PHP 8.0 FastCGI Process Manager.
dpkg: error processing package php8.0-fpm (--configure):
installed php8.0-fpm package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
php8.0-fpm
E: Sub-process /usr/bin/dpkg returned an error code (1)
知道“/etc/php/8.0/fpm/”中沒有“php-fpm.conf”檔案
uj5u.com熱心網友回復:
通過日志我以某種方式看到您丟失了組態檔:/etc/php/8.0/fpm/php-fpm.conf
所以我在我的服務器中找到了一個并提交給 Gist。
需要把它放在你的服務器上。
在終端:
cd ~
wget https://gist.githubusercontent.com/num8er/6cf84e1a544cc7751d3f6974d10b10a0/raw/d9bf057d3acc297d79235b282319f29f60a4301b/php-fpm.conf
sudo mv php-fpm.conf /etc/php/8.0/fpm/php-fpm.conf
sudo systemctl restart php8.0-fpm
如果您仍然有問題,請卸載所有 php 內容,然后重新安裝:
apt purge -y php7.4*
apt purge -y php8.0*
apt-get install php8.0 php8.0-fpm php8.0-dev php8.0-bz2 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-gd php8.0-intl php8.0-mbstring php8.0-mysql php8.0-mysqli php8.0-pdo php8.0-opcache php8.0-pspell php8.0-readline php8.0-xml php8.0-zip php8.0-imagick
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/449841.html
