FS#39218 - [php] Enable thread safety
Attached to Project:
Arch Linux
Opened by Ľubomír Kučera (Kuci) - Friday, 07 March 2014, 20:05 GMT
Last edited by Anatol Pomozov (anatolik) - Tuesday, 11 March 2014, 19:44 GMT
Opened by Ľubomír Kučera (Kuci) - Friday, 07 March 2014, 20:05 GMT
Last edited by Anatol Pomozov (anatolik) - Tuesday, 11 March 2014, 19:44 GMT
|
Details
With the latest Apache 2.4.7, PHP and its extensions need to
be compiled with thread safety enabled. Otherwise, Apache
will not start.
To enable thread safety use '--enable-maintainer-zts' parameter. |
This task depends upon
Closed by Anatol Pomozov (anatolik)
Tuesday, 11 March 2014, 19:44 GMT
Reason for closing: Won't fix
Additional comments about closing: Users should use thread-safe MPM instead.
Tuesday, 11 March 2014, 19:44 GMT
Reason for closing: Won't fix
Additional comments about closing: Users should use thread-safe MPM instead.
FS#39107andFS#39214."By default Apache uses thread-safe MPM engine, but PHP compiled without it. To use provided php module change
LoadModule mpm_event_module modules/mod_mpm_event.so
to
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so"
BTW why mod_php was compiled without thread-safety? Is it security/stability issue?
If you want mod-php, use prefork. If you want the advantages of worker or event mpm, you're not looking at mod-php anyways.
Edit: I'm sorry, JGC in the comment above me is right. If you use mod-php, you should use mpm_prefork. For most other Apache plugins, you should use mpm_event.
I think anatolik's post_install suggestion would be very useful.
edit: we need to post something on the frontpage blog about this, because this has been breaking people's setups, and Apache + PHP is a pretty default option.
This should be documented in the wiki, adding post_install messages won't solve anything because nobody reads those when they're installing more than just PHP.
I fully agree, this should be documented in the wiki, however, this configuration may not be suitable for all use cases.
jgc: although there are users who does not read installation message there are users who does it (and *should* read it). I believe that this mod_php issue will be a source of questions for a long time. And to avoid questions we need to add good documentation. wiki, arch news, install messages all these are documentation that will be helpful to users.
Pierre, I would like to add a post_install() message to php-apache module. Let me know if you have objections.
Part of the problem is that mod_php error message "Apache is running a threaded MPM, but your PHP Module is not
compiled to be threadsafe. You need to recompile PHP." is too confusing. It suggests binaries recompilation which is not the best solution. The error message should be "Apache is running a threaded MPM, but your PHP Module is not
compiled to be threadsafe. Either change MPM to thread-safe one (mpm_prefork) or recompile PHP with --enable-maintainer-zts flag". My point is that the error message should recommend changing MPM as a first solution. Please contact PHP upstream.