英文:
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-php
apt-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'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 'mpm'``` command return :
```mpm_event_module (shared)```
But when trying to enable php8.2 with ```a2enmod php8.2``` I'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>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论