gpt4 book ai didi

php - 更新到 php8.0 时无法启动 PHP 8.0 FastCGI 进程

转载 作者:行者123 更新时间:2023-12-04 19:25:25 28 4
gpt4 key购买 nike

我正在尝试从 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”文件

最佳答案

通过日志我以某种方式看到您丢失了配置文件:/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

关于php - 更新到 php8.0 时无法启动 PHP 8.0 FastCGI 进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71620771/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com