让 HTTP/2 在 Debian 8 上的 Apache 2.4.29 上工作

Rin*_*nav 3 openssl php5 apache-2.4 debian-jessie http2

我正在尝试更新我的 apache2(Apache/2.4.29 (Debian 8))服务器以支持,http2 但在使用以下代码启用 http2 后,由于mpm_prefork不支持而无法正常工作http2

<IfModule http2_module>
    ProtocolsHonorOrder On
    Protocols h2 h2c http/1.1
</IfModule> 
Run Code Online (Sandbox Code Playgroud)

由于mpm_preforkapache (2.4.29) 不适用于http2,我尝试使用 mpm_event/mpm_worker 但它不起作用,所以我启用mpm_prefork

sudo a2dismod mpm_event 
sudo a2dismod mpm_worker 
sudo a2enmod mpm_prefork
Run Code Online (Sandbox Code Playgroud)

由于我仍在运行,php5
我应该怎么做才能在 Debian8 上获得 http2 支持?我是否必须将 php5 更新为 php7?是否有任何解决方法可以将 mpm_worker/mpm_event 与具有 http2 支持的 php5 一起使用?

阿帕奇错误日志

[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'
Run Code Online (Sandbox Code Playgroud)

小智 7

最好升级到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.
Run Code Online (Sandbox Code Playgroud)