apache www.example.com的问题libphp.so|公司简介|Red Hat 7.9上的HTTPD 2.4.56

olhwl3o2  于 2023-03-24  发布在  Apache
关注(0)|答案(1)|浏览(122)

你好,我一直面临着一个问题,从雷米在红帽7.9和httpd编译的php 80。
每当在httpd.conf上加载PHP 8模块(LoadModulephp_modulemodules/libphp.so)时,我都会收到错误。
$〉httpd/bin/httpd -k start
[Wed Mar 22 19:25:35.143647 2023] [php:crit] [pid 45645:tid 140029428127616] Apache正在运行一个线程化的MPM,但是您的PHP模块没有被编译为线程安全的。您需要重新编译PHP AH 00013:预配置失败
$〉/app/httpd/bin/httpd -M
core_module(static)
so_module(static)
http_module(静态)
mpm_worker_module(静态)
authn_file_module(共享)
authn_core_module(共享)
authz_host_module(共享)
authz_groupfile_module(共享)
authz_user_module(共享)
authz_core_module(共享)
access_compat_module(共享)
auth_basic_module(共享)
reqtimeout_module(shared)
filter_module(共享)
mime_module(shared)
log_config_module(共享)
env_module(shared)
headers_module(shared)
setenvif_module(shared)
version_module(共享)
unixd_module(共享)
status_module(共享)
autoindex_module(共享)
dir_module(shared)
alias_module(共享)
我试着使用另一个libphp.so从另一个安装(CentOS7),php 80和httpd安装从yum.这一个工程...

krcsximq

krcsximq1#

EL-7是旧的,非常旧(~9年),接近其寿命结束(~1年)

因此,我衷心地推荐使用一个现代的发行版来获得现代的特性,比如PHP 8
Apache正在运行一个线程化的MPM,但是你的PHP模块没有被编译成线程安全的。

mod_php只能作为NTS使用(RPM),ZTS构建(线程安全)不可用,因为会引发太多问题(segfault),所以大多数情况下无法支持。

请参见PHP documentation上的警告
你有两种方法
1/将httpd切换到“prefork”模式,以便能够使用mod_php
注意:mod_php仅设计用于默认系统httpd版本2.4.6
2/使用httpd在“事件”模式下使用php-fpm
php-fpm与httpd(任何版本),nginx和其他一些web服务器一起工作
为此,您可以读取PHP Configuration Tips
注意事项:

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

相关问题