Raspbian升级到php 7.4至8.0后出现MPM错误。

huangapple go评论67阅读模式
英文:

Raspbian MPM error after php 7.4 to 8.0 upgrade

问题

On my raspbian (buster) 我的Raspbian(Buster)上,升级php从7.4到8.0后,我可以摆脱以下错误:Configuration error: No MPM loaded配置错误:未加载MPM

When trying to enable mpm_prefork it says that it doesn't exist :尝试启用mpm_prefork时,它说它不存在:
ERROR: Module mpm_prefork does not exist!错误:模块mpm_prefork不存在!

I did installed libapache2-mod-php :我安装了libapache2-mod-php:
apt-get install libapache2-mod-phpapt-get安装libapache2-mod-php

The apachectl -M | grep 'mpm' command return :apachectl -M | grep 'mpm'命令返回:
mpm_event_module (shared)mpm_event_module(共享)

But when trying to enable php8.2 with a2enmod php8.2 I'm getting :但是尝试使用a2enmod php8.2启用php8.2时,我得到:

Considering dependency mpm_prefork for php8.2:
ERROR: Module mpm_prefork does not exist! 
ERROR: Could not enable dependency mpm_prefork for php8.2, aborting
```考虑到php8.2的依赖mpm_prefork:
错误:模块mpm_prefork不存在!
错误:无法启用php8.2的依赖mpm_prefork,中止

I have no clue anymore, help would be appreciate!我不知道了,帮助将不胜感激!

<details>
<summary>英文:</summary>

On my raspbian (buster) I can get rid of the following error after upgrading php from 7.4 to 8.0 : 
`Configuration error: No MPM loaded`

When trying to enable mpm_prefork it says that it doesn&#39;t exist :
```ERROR: Module mpm_prefork does not exist!```

I did installed libapache2-mod-php :
```apt-get install libapache2-mod-php```

The ```apachectl -M | grep &#39;mpm&#39;``` command return : 
```mpm_event_module (shared)```

But when trying to enable php8.2 with ```a2enmod php8.2``` I&#39;m getting : 

Considering dependency mpm_prefork for php8.2:
ERROR: Module mpm_prefork does not exist!
ERROR: Could not enable dependency mpm_prefork for php8.2, aborting



I have no clue anymore, help would be appreciate!


</details>


# 答案1
**得分**: 0

安装命令是 `sudo apt-get install apache2-mpm-prefork`。

但是,请确保你知道你在做什么,安装了什么等等。

一些配置会禁用 `mpm_prefork` 并使用 `mpm_event` 代替。要知道需要查看你的 Apache 配置,哪些模块已启用和配置,应用程序要求,PHP 与 PHP-FPM 配置等等。

也有可能你同时配置了 PHP 7.4 和 PHP 8.0,这可能会破坏你的 Apache 配置。

在最糟糕的情况下,你可能需要彻底卸载 PHP 7.4 和 PHP 8.0。然后安装 PHP 8.0。

注意:PHP 8.2 是当前版本。除非你对 8.0 有特殊要求,否则请使用 8.2。

<details>
<summary>英文:</summary>

The install command is `sudo apt-get install apache2-mpm-prefork`.

However, make sure you know what you are doing, what is installed, etc.

Some configurations disable `mpm_prefork` and use `mpm_event` instead. To know requires reviewing your Apache configuration, which modules are enabled and configured, the application requirements, PHP versus PHP-FPM configuration, etc. 

It is also possible that you have a mix of both PHP 7.4 and PHP 8.0 configured, which is breaking your Apache configuration. 

In the worst case, you might need to uninstall PHP 7.4 and PHP 8.0 completely. Then install PHP 8.0. 

Note: PHP 8.2 is the current version. Use 8.2 unless you have requirements for 8.0.

</details>



huangapple
  • 本文由 发表于 2023年7月18日 10:54:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76709256.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定