FS#58930 - [php] Compile PHP threadsafe, required for http2 in Apache

Attached to Project: Arch Linux
Opened by rainer (raneon) - Friday, 08 June 2018, 14:36 GMT
Last edited by Jan de Groot (JGC) - Saturday, 09 June 2018, 09:24 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Description: If I want to enable MPM event in Apache httpd, I get the following error message "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP." The wiki even mentions this error message and it recommends to use MPM prefork instead. This works for starting httpd, but then http2 doesn't work anymore, as support has been removed in MPM prefork with one of the last Apache releases. So there seems no way back and forth, if http2 is required.

Additional info:
* Apache 2.4.33
* PHP 7.2.6
* Enable MPM event instead of MPM prefork in httpd.conf

Steps to reproduce:
1. Enable MPM event
2. Restart httpd
This task depends upon

Closed by  Jan de Groot (JGC)
Saturday, 09 June 2018, 09:24 GMT
Reason for closing:  Won't implement
Comment by Jan de Groot (JGC) - Friday, 08 June 2018, 17:35 GMT
Even if php is compiled threadsafe, there's no warranty that external libraries are threadsafe.
We've seen multiple requests for this, we will still not implement it. Using php-fpm and mod_proxy_fcgi is recommended instead.
Comment by rainer (raneon) - Friday, 08 June 2018, 20:26 GMT
Hi Jan, thanks four your feedback. I struggled to find a working combination of mpm, php-fpm, fcgi and http2. The wiki was quite confusing to me, not sure which combination is expected to work. After switching now to php-fpm and mod_proxy_fcgi (and disabling mpm event/prefork) apache complained that "AH00534: httpd: Configuration error: No MPM loaded", where the wiki promotes the use of mpm prefork. As it will not work with http2, I enabled after several unsuccessful tests mpm event again, expecting to get the threadsafe error. But this seems to work now. Is the correct solution to combine php-fpm, mod_proxy_fcgi with mpm event?
Comment by Jan de Groot (JGC) - Friday, 08 June 2018, 20:36 GMT
that's the prefered combination yes.
Comment by rainer (raneon) - Saturday, 09 June 2018, 06:45 GMT
Thank you. Please feel free to close the bug, the proposed solution works well.