我正在尝试更新我的 apache2(Apache/2.4.29 (Debian 8))
服务器以支持,但在使用以下代码启用 http2 后,由于不支持http2
,它无法工作mpm_prefork
http2
<IfModule http2_module>
ProtocolsHonorOrder On
Protocols h2 h2c http/1.1
</IfModule>
由于mpm_prefork
apache (2.4.29) 不能与 一起使用http2
,我尝试使用 mpm_event
/mpm_worker
但它不起作用,所以我启用mpm_prefork
sudo a2dismod mpm_event
sudo a2dismod mpm_worker
sudo a2enmod mpm_prefork
由于我仍在运行,php5
我应该怎么做才能在 Debian8 上获得 http2 支持?我是否必须将 php5 更新到 php7?是否有任何解决方法可以将 mpm_worker/mpm_event 与支持 http2 的 php5 一起使用?
Apache 错误日志
[http2:warn] [pid 11992] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[mpm_prefork:notice] [pid 11992] AH00163: Apache/2.4.29 (Debian) OpenSSL/1.1.0g configured -- resuming normal operations
[core:notice] [pid 11992] AH00094: Command line: '/usr/sbin/apache2'
答案1
最好升级到php7,安装php7.x-fpm,使用mpm_event(或者mpm_worker)模块:
apt-get install php7.x-fpm # install the php-fpm
a2enmod proxy_fcgi
a2enconf php7.x-fpm
a2dismod php7.x # disables mod_php.
a2dismod mpm_prefork
a2enmod mpm_event # enable event MPM. You could also enable mpm_worker.