Issues with libphp.so | PHP80 | HTTPD 2.4.56 on Red Hat 7.9

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

Issues with libphp.so | PHP80 | HTTPD 2.4.56 on Red Hat 7.9

问题

Hello I've been facing an issue with php80 from Remi on Red Hat 7.9 and httpd compiled.
每当在httpd.conf上加载PHP8模块(LoadModule php_module modules/libphp.so)时,我会遇到以下错误。
$>httpd/bin/httpd -k start
[Wed Mar 22 19:25:35.143647 2023] [php:crit] [pid 45645:tid 140029428127616] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP
AH00013: Pre-configuration failed
$>/app/httpd/bin/httpd -M
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
authn_file_module (shared)
authn_core_module (shared)
authz_host_module (shared)
authz_groupfile_module (shared)
authz_user_module (shared)
authz_core_module (shared)
access_compat_module (shared)
auth_basic_module (shared)
reqtimeout_module (shared)
filter_module (shared)
mime_module (shared)
log_config_module (shared)
env_module (shared)
headers_module (shared)
setenvif_module (shared)
version_module (shared)
unixd_module (shared)
status_module (shared)
autoindex_module (shared)
dir_module (shared)
alias_module (shared)
我尝试使用另一个来自另一个安装(CentOS7)的libphp.so,php80和httpd是通过yum安装的。那个可以正常工作...

英文:

Hello I've been facing an issue with php80 from Remi on Red Hat 7.9 and httpd compiled.<br><br>
Whenever PHP8 module is loaded (LoadModule php_module modules/libphp.so) on httpd.conf, I get the error.<br><br>
$>httpd/bin/httpd -k start<br><br>
[Wed Mar 22 19:25:35.143647 2023] [php:crit] [pid 45645:tid 140029428127616] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP
AH00013: Pre-configuration failed<br><br>
$>/app/httpd/bin/httpd -M<br>
core_module (static)<br>
so_module (static)<br>
http_module (static)<br>
mpm_worker_module (static)<br>
authn_file_module (shared)<br>
authn_core_module (shared)<br>
authz_host_module (shared)<br>
authz_groupfile_module (shared)<br>
authz_user_module (shared)<br>
authz_core_module (shared)<br>
access_compat_module (shared)<br>
auth_basic_module (shared)<br>
reqtimeout_module (shared)<br>
filter_module (shared)<br>
mime_module (shared)<br>
log_config_module (shared)<br>
env_module (shared)<br>
headers_module (shared)<br>
setenvif_module (shared)<br>
version_module (shared)<br>
unixd_module (shared)<br>
status_module (shared)<br>
autoindex_module (shared)<br>
dir_module (shared)<br>
alias_module (shared)<br>
<br><br>
I tried using another libphp.so from another installation (CentOS7), php80 and httpd installed from yum. That one works...

答案1

得分: 1

EL-7 已经很老,非常老(约9年),接近生命周期结束(约1年)

所以我强烈建议使用现代发行版以获得现代功能,比如 PHP 8

Apache 正在运行一个线程化的 MPM,但你的 PHP 模块没有编译为线程安全。

mod_php 仅以 NTS、ZTS 构建(线程安全)的 RPM 包可用,因为它引发了太多问题(段错误),所以基本不可能支持。

请查看 PHP 文档 上的警告。

你有两种方式:

1/ 将 httpd 切换到“prefork”模式以使用 mod_php

注意:mod_php 仅设计用于与默认系统的 httpd 版本 2.4.6 一起使用。

2/ 使用“event”模式的 httpd 与 php-fpm

php-fpm 与 httpd(任何版本)、nginx 和其他一些 Web 服务器兼容。

为此,你可以阅读 PHP 配置提示

注意:

EL-8 现在默认使用 php-fpm(如果切换到 prefork,mod_php 仍然可用)

EL-9 仅提供 php-fpm

英文:

EL-7 is old, terribly old (~9 years) and close to its end of life (~1 year)

So I heartily recommend using a modern distro for modern features such as PHP 8

> Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.

mod_php is only available (in RPMs) as NTS, ZTS builds (threadsafe) are not available because raise too much issues (segfault) so mostly impossible to support.

See the warning on PHP documentation

You have 2 ways

1/ switch httpd in "prefork" mode to be able to use mod_php

Notice: mod_php is only designed to work with the default system httpd version 2.4.6

2/ use httpd in "event" mode with php-fpm

php-fpm works with httpd (any version), nginx and some other web servers

For this, you can read PHP Configuration Tips

Notice:

EL-8 now uses php-fpm by default (mod_php still available if you switch to prefork)

EL-9 only provides php-fpm

huangapple
  • 本文由 发表于 2023年3月23日 08:32:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/75818358.html
匿名

发表评论

匿名网友

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

确定