Bug 207284 - www/mod_php70 fails if zts is enabled or www/apache24 is configured with non prefork mpm
Summary: www/mod_php70 fails if zts is enabled or www/apache24 is configured with non ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Martin Wilke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-17 20:07 UTC by Jack
Modified: 2016-11-28 18:31 UTC (History)
6 users (show)

See Also:
koobs: maintainer-feedback? (tz)
koobs: merge-quarterly?


Attachments
config.log of make with ZTS checked (80.29 KB, text/plain)
2016-02-17 20:07 UTC, Jack
no flags Details
Output of: /usr/local/sbin/pkg-static info -g -Ea (8.08 KB, text/plain)
2016-02-17 20:08 UTC, Jack
no flags Details
php70 patch from comment 8 (482 bytes, patch)
2016-11-28 14:22 UTC, Kubilay Kocak
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jack 2016-02-17 20:07:46 UTC
Created attachment 167119 [details]
config.log of make with ZTS checked

mod_php70 fails if the www/apache24 port is configured to use any MPM other than prefork (I selected event and worker mpms and they both fail the same way).
Comment 1 Jack 2016-02-17 20:08:34 UTC
Created attachment 167120 [details]
Output of: /usr/local/sbin/pkg-static info -g -Ea
Comment 2 Jack 2016-02-17 20:10:21 UTC
Looks like ZTS or not ZTS build for mod_php70 will fail if apache24 is configured with a non prefork mpm selected.
Comment 3 Olli Hauer freebsd_committer freebsd_triage 2016-02-17 20:20:07 UTC
Hm, cannot comment at the moment since I haven't tested php7 at the time, but I think there are already report from users using apache24 with php7 (freebsd-ports mailing list).

Perhaps it will be a good idea to deprecate mod_php altogether and pointing users to php-fpm.
https://wiki.apache.org/httpd/PHP-FPM
Comment 4 rainer 2016-02-17 21:02:07 UTC
It works with apache22 (well, it builds - haven't been able to actually try it, unfortunately).

BTW: if you use php-fpm, does one still need to enable the ZTS-option?
There's surprisingly little information about the whole ZTS topic.

I only use PHP-FPM ever since it started to be included in PHP 5.3.
Comment 5 Olli Hauer freebsd_committer freebsd_triage 2016-02-17 21:09:19 UTC
(In reply to rainer from comment #4)
No, with php-fpm ZTS is not required.

In best case mod_php7 will go away, mod_php is the only reason apache24 default to prefork MPM instead of worker so we do mot need a second set of ports/packages for php.
Comment 6 Olli Hauer freebsd_committer freebsd_triage 2016-02-17 21:09:53 UTC
(In reply to Olli Hauer from comment #5)
s/worker/event/
Comment 7 rainer 2016-02-17 21:14:55 UTC
I was thinking along that (PHP-FPM is after all completely decoupled from the web-server and its threading-mechanism). But in the discussion on github, somebody said something like "it may still be needed for some modules".
I was looking for some more documentation about this - but there simply isn't.
mod_php might still be needed by some. So, as little as I care for it, I just assume it should be kept around for a while for those poor souls who haven't got time to migrate.
Comment 8 Martin Wilke freebsd_committer freebsd_triage 2016-02-18 06:44:19 UTC
Hi,

Can you please try the following patch?

https://people.freebsd.org/~miwi/patches/php70-zts-phtread.diff
Comment 9 Daniel Austin 2016-02-18 08:57:58 UTC
(In reply to Olli Hauer from comment #3)
php-fpm has many of its own issues, which is why I specifically *dont* use it.
Also, php-fpm has issues with modules such as simplexml (with or without ZTS enabled)

I can't even begin to count the number of servers i've reverted from using php-fpm to mod_php or suphp methods after issues with specific modules under fpm.
Comment 10 Jack 2016-02-19 01:21:47 UTC
I'll test the patch out and let you know.
Comment 11 Jack 2016-02-19 03:34:04 UTC
Compiles fine with the patch
Comment 12 John Cooper 2016-04-05 11:05:59 UTC
The mod_php isn't threadsafe. See my report.
Comment 13 Rene Ladan freebsd_committer freebsd_triage 2016-07-25 19:12:31 UTC
miwi@ resigned.
Comment 14 Kubilay Kocak freebsd_committer freebsd_triage 2016-11-28 14:22:59 UTC
Created attachment 177484 [details]
php70 patch from comment 8

Assign tz@ (php70/mod_php70 maintainer) - Re-open.

You may want to start with the patch from comment 8 (attached here)
Comment 15 Po-Chuan Hsieh freebsd_committer freebsd_triage 2016-11-28 18:31:16 UTC
FYI, this fix was already approved by miwi@ and committed by fluffy@ in r415304 in May. So I reassign this PR back to miwi@ and close.