Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP74 apache buster HTTP2 not working #927

Closed
michaljusiega opened this issue Dec 18, 2019 · 6 comments
Closed

PHP74 apache buster HTTP2 not working #927

michaljusiega opened this issue Dec 18, 2019 · 6 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@michaljusiega
Copy link

Hello.
I'm using a 7.4.0-apache-buster image from your docker-hub.
I'm using SSL on Apache in vhost, but I can't run h2 / h2c.
The problem only occurs because PHP SAPI is: ApacheHandler and HTTP2 Apache requires PHP-FPM and mpm_prefork probably.

How to quickly and painlessly start HTTP2 using the basis of your image?

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Dec 18, 2019
@wglambert
Copy link

Currently the apache variant doesn't support http2 as it uses mpm_prefork which is incompatible for http2 https://http2.pro/doc/Apache#Troubleshooting

Apache 2.4.27, HTTP/2 not supported in prefork
If you are using PHP, it is likely that PHP is integrated to Apache via the mod_php module, which requires the prefork MPM. If you switch out from preform MPM, you will need to use PHP as FastCGI.

There's currently a PR open for this #785 and a discussion on http2 at #558

I think the easiest way to use HTTP/2 with this image today would be to instead use the FPM variants and connect them via NGINX instead (or another load balancer / reverse proxy).

@michaljusiega
Copy link
Author

So I must just wait? Thanks ;)

@tianon
Copy link
Member

tianon commented Dec 18, 2019 via email

@michaljusiega
Copy link
Author

This is not a solution to the problem but a workaround.
Anyway my projects are closely related to Apache it would be hard for modification to NGINX ;)

Besides, if you offer a ready image with an apache and a buster, why even add Nginx? I prefer to wait for some other solution, but thank you for the suggestion;)

@tianon
Copy link
Member

tianon commented Dec 23, 2019

Using FPM + NGINX is not just a workaround, but is the only currently-supported solution to your use case. 😕

Either way, I'm closing this as a duplicate of #558, where HTTP/2 support is being discussed. 👍

@tianon tianon closed this as completed Dec 23, 2019
@o-alquimista
Copy link

o-alquimista commented Jan 1, 2021

@michaljusiega How about using httpd + php with one of the -fpm versions? This approach is being used by Fedora/RHEL/CentOS nowadays. Fedora even dropped mod_php recently in favor of php-fpm.

The httpd module mod_php is also dropped, as php-fpm is a more performant and more secure PHP module.

  1. Enable and configure mod_proxy_fcgi. The connection between httpd and php-fpm can be done through unix socket (use a Docker-managed volume) or TCP (placing both containers in the same Docker network).
  2. Enable the mpm_event and mod_http2 modules
  3. Set Protocols

Mount the files you're serving under /var/www/ on both containers so that httpd can access your document root as well for the virtual host configuration.

To consistently handle error responses when using httpd's ErrorDocument directive, enable the following directive in httpd:

ProxyErrorOverride On

# Except for scripts that return JSON
<Directory /var/www/your_project/ajax/>
    ProxyErrorOverride Off
</Directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

4 participants