Problem/Motivation
When using a core trait in a contrib module, my site started whitescreening.
The only thing in the Apache log was zend_mm_heap corrupted, no other messages.
That led me to https://bugs.php.net/bug.php?id=62339, which was fixed in PHP 5.4.5
Proposed resolution
Debian wheezy ships with PHP 5.4.4 but it is patched and it does not have this problem (#29)
- Maintain compatibility with Debian Wheezy
- Bump the PHP version requirement to 5.4.5 for everyone else.
Remaining tasks
Commit
User interface changes
None
API changes
New constant DRUPAL_MIMINUM_PHP_DEBIAN to track compatibility with Debian's patched PHP versions.
| Comment | File | Size | Author |
|---|---|---|---|
| #84 | 2267551-84.patch | 2.31 KB | jfhovinne |
| #68 | 2267551-68.patch | 1.41 KB | jfhovinne |
| #65 | 2267551-65.patch | 1.38 KB | jfhovinne |
| #53 | 2267551-53.patch | 3.76 KB | jfhovinne |
| #51 | 2267551-51.patch | 4.21 KB | jfhovinne |
Comments
Comment #1
jessebeach commentedI think we're now required to bump the minimum PHP Version requirement to 5.4.5. I can't get a single page to load on PHP 5.4.4.
Comment #2
jessebeach commentedSo, let's not hem and haw about it :)
https://drupal.org/requirements
Comment #3
alberto56 commentedPossibly related: I'm getting zend_mm_heap corrupted with running tests from the command line:
Comment #4
tim.plunkettThat's exactly this bug. 5.4.5 fixes that.
Comment #5
alberto56 commented@tim.plunkett thanks!
Confirming that the problem does not occur with a higher version of PHP.
As a user of MAMP, I upgraded to the latest version of MAMP which includes php 5.5, which solves my problem.
Comment #6
dawehnerMh, so this is a conflict between debian, which uses php 5.4.4 and people using MAMP, which can update without any big issues.
Comment #7
catchSeems critical to me.
Comment #8
cdnsteve commentedWhy not bump the required release of PHP?
Latest in 5.4 branch is .33
http://php.net/archive/2014.php#id2014-09-18-2
Comment #9
peterx commentedGiven the difficulty a regular site owner would have diagnosing the problem, we should bump the minimum level to avoid the problem.
Comment #10
rickmanelius commentedI was just testing a fresh install of Drupal 8 beta1 and I happened to be on php 5.4.4. I couldn't get through an install. I updated to a newer version (5.4.19) and that resolved the issue.
I agree with the others on the thread. While most people should already be further along the 5.4.x branch, it should be stated as an explicit requirement so as to avoid tickets being filed against this known issue.
Comment #11
catchLet's bump to 5.4.5 for now.
Comment #12
arlinsandbulte commentedSimple enough.
Looks good.
Comment #13
alexpottCommitted 8d97fff and pushed to 8.0.x. Thanks!
Comment #15
star-szrDo we want to update the other instances of 5.4.2 in core?
Edit: install.php seems most relevant here…
Comment #16
basvredelingDocumentation needs to be updated too. Spefically these pages:
Comment #17
ricardoamaro commentedNew PHP5.4 container and all tests started to fail:
https://www.drupal.org/node/2349705
Comment #18
ricardoamaro commentedExample of the run:
http://coreresults.drupal-pt.org/sites/default/files/build_D80x_mysql55_...
Comment #19
dasrecht commentedHi there,
the drupal testbot team just got across this one.
bumping the minimal php version breaks drupal currently on all debian systems since they are locked on php 5.4.4
i'm currently checking with the debian package maintainers when 5.4.5 is expected.
we are already working on a workaround for this : https://www.drupal.org/node/2349705
/bastian
Comment #20
arlinsandbulte commentedCreated #2349969: Update all references of PHP 5.4.2 to 5.4.5 (code & docs) to followup on references and docs.
Comment #21
jfhovinne commentedThat means it is not possible anymore to install D8 on standard Debian stable (Wheezy), are you sure it is a good idea to require 5.4.5 ?
I was still able to install it yesterday on all my Debian Wheezy VMs, now I am forced to upgrade PHP everywhere ...
For me this is a blocker.
Comment #22
basvredelingYou can't install current Drupal 8 release on wheezy anyway because of the php5.4.4 incompatibility. As such your situation is not worse than before the new requirement. Only alternative would be to change the order in which traits are loaded in the installation script.
Comment #23
jfhovinne commentedActually I *am able* to install current 8.0.x on a fresh Debian Wheezy, by *reverting #11 patch*.
PHP version is 5.4.4 ( 5.4.4-14+deb7u14, see https://packages.debian.org/wheezy/php5 ).
So for me the situation is worse than before the new requirement.
I would suggest to revert the patch and find another solution.
Also, the issue description does not mention D8 installation, but "using a core trait in a contrib module", so I am not sure what the problem is.
Comment #24
mike3933 commentedI am facing problem with php5.4.4. I would be upgrading server's PHP version.
Comment #25
jfhovinne commented@mike3933 could you describe system configuration and steps to reproduce the bug ? Thanks.
Comment #26
jfhovinne commentedIn the meantime, I can confirm that D8 installation works as expected on Debian Wheezy using default PHP 5.4.4 (and reverting the patch in #11 of course).
Tested on a dedicated server and on a VM, using the UI or drush si.
Comment #27
basvredelingIf you can install without any problems on Wheezy, we need to find out why your php 5.4.4 doesn't pose any problems whereas mine on MAMP does. Or, for the time being, we submit a reversal patch.
Comment #28
ParisLiakos commenteda. patch in #11 is incomplete
b. and most importantly..bumping the php version above 5.4.4 that debian wheezy ships with (dunno for other distros, but we should check) for a MAMP problem? Well, definitely needs more conversation
git revert 8d97fffComment #29
jfhovinne commented@basvredeling I just found why the problem does not occur on Wheezy : the patch at https://github.com/php/php-src/commit/90e23107a2acba1fd53b7e799372eb9f24... has been backported to the Wheezy PHP 5.4.4 package, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685765
You can find it in the diff at http://security.debian.org/debian-security/pool/updates/main/p/php5/php5... as well.
So forcing upgrading PHP to 5.4.5+ on Debian production servers is not necessary.
Here is the reversal patch.
Comment #30
tim.plunkettThis is not Debian vs MAMP. This is 5.4.4 vs 5.4.5/5.4.4-patched.
Comment #31
ParisLiakos commentedoh, nice research #29..so this is not just a mamp issue, it wasnt happening on wheezy because its patched..hmm, in that case, bumping to 5.4.5 makes sense..
it still sucks big time that D8 wont run on vanilla wheezy though :(
Comment #32
catchDiscussed this with jthorson in person and he pointed out that both the (new) test bot and people in this issue had been installing OK with Debian wheezy.
I think what might be happening is Debian has backported the fix for this into their fork of PHP 5.4.4, so it works on Debian but not with 5.4.4 on anything else.
I don't think there's any reason to break Wheezy if we don't have to, so I've rolled back the patch for now. Might need to figure out if PHP 5.4.whatever-patch-wheezy would work as a requirement.
Comment #33
catch@ParisLiakos we need to research for definite but I don't think this is an issue in stock Debian wheezy either. It's just that Debian's policy keeps them on 5.4.4 even though they backport things from later releases.
Comment #35
tim.plunkettSo now D8's PHP min version only works for Debian, too bad for *everyone else*?
Comment #36
jfhovinne commented@tim.plunkett indeed, so we need to find a solution that suits everybody.
@catch thanks for the rollback.
I see that MAMP provides 5.4.4 and PHP 5.4.25, and nothing in-between.
Would
DRUPAL_MINIMUM_PHP = '5.4.4-14'be a possible workaround ?I guess that
version_compare('5.4.4', '5.4.4-14', '<')would return true, no ?Comment #37
catch@Tim yes that's why it's a critical bug. It was already broken for everyone on 5.4.4 and not on Debian with a bad error message and they'll need to upgrade. Better than forcing people to use a non default PHP build on Debian for no valid reason
Comment #38
ParisLiakos commentedVery good idea! it works indeed..maybe then a patch like that? (needs some testing with a couple scenarios i guess)
Comment #39
jfhovinne commentedActually
if (version_compare($phpversion, DRUPAL_MINIMUM_PHP) < 0)in core/modules/system/system.install line 75 will fail in caseDRUPAL_MINIMUM_PHP = '5.4.4-14'and php version is 5.4.4-14, since the comparison returns 0.Thus I would suggest to update it to
if (version_compare($phpversion, DRUPAL_MINIMUM_PHP) <= 0).Also I am not sure what
phpversion()returns on MAMP with PHP 5.4.4; would be great to get the exact output.FYI RHEL and CentOS are still on 5.3.3 (http://mirror.centos.org/centos/6/os/x86_64/Packages/), while packages exists for 5.4.1 and 5.4.6 ( http://fr2.rpmfind.net/linux/rpm2html/search.php?query=PHP&submit=Search+... ), and not 5.4.4, so the 5.4.4-14 minimum will probably work in this case.
Comment #40
basvredelingI agree with Tim Plunkett that the issue for everyone else is pretty grave. A non-patched php5.4.4 just fails installation without any notice why. Documentation from #2349969: Update all references of PHP 5.4.2 to 5.4.5 (code & docs) will only help a bit to prevent this fatal error. Being outdated is something Drupal installer should warn about.
Yes, wheezy is more important than a local dev environment. But php 5.4.4 is just incompatible. So this wont just affect me or other people on the previous major mamp release (2.x). I didn't mean to make this a MAMP discussion in any way. I tried virtualising Ubuntu with php 5.4.4 but lacked the time to verify it. Then stumbled upon this issue. Considered it verified.
To give you an idea. I've spent about 3 hours bumping my head into this issue. I've successfully installed an earlier alpha of D8 on exactly the same environment. There was no hint whatsoever that this could be caused by being on a version of PHP which suddenly became outdated between D8 alpha releases. Adding the 5.4.4 requirement as in #11 is valid as far as I see it. It should stay in while we are working on a better patch. There should really be a workaround for 5.4.4-14 systems. Or perhaps an option to ignore the php minimum version in the installer. The consequence for 5.4.4-14 users is the inability to install Drupal 8. The consequence for everyone else on <5.4.5 is a fatal error.
Comment #41
ParisLiakos commentedhmm, actually in a debian wheezy installation i just tested PHP_VERSION is "5.4.4-14+deb7u14"
and
version_compare('5.4.4-14+deb7u14', '5.4.4-14', '<')returnsTRUE-.-If i switch to '5.4.4-13' it works as should though..so maybe we should switch to '5.4.4-13', i think its safe enough
Comment #42
catchIt's a hard requirement to prevent people from finding unexpected fatal errors hours or months after installing Drupal. Not every PHP version incompatibility results in a fatal error on install, we're very lucky that this one does.
Which they could previously do fine, then their choice is to hack core or change their PHP version unnecessarily.
Added a note to the release notes for now: https://www.drupal.org/node/2348025
version_compare() fix looks good.
Comment #43
jfhovinne commentedIMHO stating that minimum version is 5.4.4-13 because
version_compare('5.4.4-14+deb7u14', '5.4.4-14', '<')returns TRUE is misleading.In install.php, I would instead suggest adding an exception for Wheezy like:
This test seems more explicit.
Thus initializing DRUPAL_MINIMUM_PHP to '5.4.5' in bootstrap.inc would be OK if we could add the 'Wheezy exception' in system.install and so on.
What do you think ?
Comment #44
catchExplicitly special-casing wheezy works for me. There's also the possibility that we'll need to raise version requirements to PHP 5.4.26 for whatever reason, but that Wheezy continues to work with PHP 5.4.4 because they backported that fix too, so it'd be less likely to break later on.
Comment #45
jfhovinne commentedOK, here is a first (incomplete) patch that adds the Wheezy special-casing.
Would be nice to test it on MAMP with PHP 5.4.4 and/or tell what
phpversion()returns on this system, so we know if the version comparison is correct.I added the DRUPAL_MINIMUM_PHP_DEBIAN_WHEEZY constant, do not know if it is a good idea or not.
Comment #46
ParisLiakos commentedGood point!
I dont like the constant very much..it will get irrelevant pretty fast..at the very least rename it to just
DRUPAL_MINIMUM_PHP_DEBIAN#45 works for wheezy..that is, i can install and use D8 without problems
So we need to test that it fails on everything else using <5.4.5
Comment #47
jfhovinne commentedThanks for the feedback. Indeed, would be great to test this on <5.4.5.
The point is this constant only exists for Wheezy, so for me it *should* explicitely mention Wheezy.
FYI, next stable Debian will ship with PHP 5.6.0 at least (see https://packages.debian.org/jessie/php5).
Thus (IMHO),
DRUPAL_MINIMUM_PHP_DEBIANis too generic.My question was more about adding yet another constant or not.
Comment #48
catchI don't think DRUPAL_MIMINUM_PHP_DEBIAN is too generic.
If jessie provides PHP 5.6, then the minimum PHP version on Debian is not going to change (short of another requirements change). It's just that people using Jessie will exceed the minimum anyway.
If wheezy gets completely dropped for support and we want to break it, or we raise our minimum PHP version in general, then it's still possible that the minimum on debian will be lower than other systems due to their naming convention.
On top of that, older versions of Debian than wheezy may be running more modern PHP versions (including a backport of the wheezy one), and the minimum applies to them just as much.
Comment #49
jfhovinne commentedI disagree with #48, as we are talking about a very particular case here, but anyway, I suggest to focus on the 5.4.4/5.4.5 issue, which currently blocks some MAMP users, AFAIK.
Would be great if a MAMP user could test #45 patch against 5.4.4, or tell what
phpversion()returns on this system, so we can go ahead. Thanks :)Comment #50
basvredelingI've tested MAMP 2.x with PHP 5.4.4
I get the PHP outdated message now before the installer is even loaded. So that's good.
Patch from #45 confirmed working.
Comment #51
jfhovinne commented@basvredeling Great, thanks for testing.
Here is the patch, hoping 5.4.4-13 in composer.json is safe enough.
Comment #52
ParisLiakos commentedthanks, patch looks great :)
i guess its fine, but maybe just ">" ?
Drupal/Component/Plugin is not affected by this bug, we should leave the requirement as is
Comment #53
jfhovinne commented@ParisLiakos you are right about 1), updated.
Not sure about 2) though, but we need to address the install issue first, so let's leave
core/lib/Drupal/Component/Plugin/composer.jsonas is for now.Comment #54
ParisLiakos commentedgreat, thanks!!
good to go now
Comment #55
basvredelingRetested. Patch from #53 is also good on MAMP 2.
Don't really like the direction of creating a Debian specific check. How many exceptions for particular configurations will we need to make if we take it to the extreme?
Uneasiness aside, this seems RTBC
Comment #56
webchickThat also feels weird to me. I would personally just make the min. version ">5.4.4-13" and have a comment somewhere that explains that's what's in Debian Wheezy. But let's see what catch says.
Comment #57
ParisLiakos commentedSee #44 why this is a good idea. "5.4.4-13" will only work now because 5.4.5 is right next to it. if we decide we need 5.4.15, we will have to actually do this anyway.
Comment #58
catchYes #44 is why we need the debian-specific check, it's not possible to hack this with the PHP version because Debian themselves are hacking the PHP version.
There aren't many issues like this that actually block an install, so I do think we need the extra complexity here. Not in a position to commit at the moment but will do so tomorrow.
Comment #59
catchCommitted/pushed to 8.0.x, thanks!
Comment #61
webchickNote this follow-up #2354301: Composer require.php : invalid version constraint
Comment #62
jfhovinne commentedUnfortunately I have to reopen this issue since the patch does not address installation of modules, which are also blocked by the 5.4.5 requirement, on Wheezy.
Thus, installation of Drupal works as expected, but installation of modules is impossible, as the message "This module requires PHP version 5.4.5 and is incompatible with PHP version 5.4.4-14+deb7u14." is displayed for each module in admin/modules, while
drush en modulereturns "module is incompatible with the PHP version".Finally #56 seems the best option to me (or a mix of #53 and #56), above all if
version_compare(PHP_VERSION, '5.4.4-13', '<')returns TRUE on MAMP with PHP 5.4.4 (again, would be great to know whatphpversion()returns on this system).Comment #63
ParisLiakos commentedhmm yes, that turns to be more complex than that..to get modules+themes to be installable on wheezy this needs to happen
this has the drawback that if we ever need to get
DRUPAL_MINIMUM_PHP5.4.6 and above, one would be able to install modules on 5.4.5, but...wont be able to get core to install at first:) so its not an issue.Comment #64
basvredeling@jfhovinne
drush eval "echo phpversion();"returns 5.4.4 on MAMP 2.1.xComment #65
jfhovinne commented@basvredeling Perfect, thanks.
Here is a patch that removes the
DRUPAL_MIMINUM_PHP_DEBIANconstant, and instead computesDRUPAL_MIMINUM_PHPby comparingPHP_VERSIONwith'5.4.4-14+deb7u14'.Should be more solid ?
Comment #66
basvredeling#65 works
Comment #67
alexpottThe problem with this is that the moment we get
5.4.4-15+deb7u15this breaks.Comment #68
jfhovinne commentedRegarding package naming, see http://metadata.ftp-master.debian.org/changelogs//main/p/php5/php5_5.4.4...
Here is something more generic.
Comment #69
larowlanI think this should be rolled back - on HEAD and with the patch at #68
Comment #70
jfhovinne commented@larowlan The Composer issue is being dealt with by #2354301: Composer require.php : invalid version constraint, and rolling back to the previous value (">=5.4.2" if I am correct) will not match the 5.4.5 requirement, so I guess it is a good idea to discuss this on 2354301, to avoid cross-posting.
Comment #71
alexpottWhy don't we use version_compare here instead of our own regex?
I think we should bump the composer version to
5.4.5in #2354301: Composer require.php : invalid version constraint and wait for an upstream fix - debian composer users can just upgrade their php or wait.Comment #72
catchI committed the patch from #2354301: Composer require.php : invalid version constraint.
Leaving this open to track the composer upstream fix (needs an issue opening against composer if there isn't one already) and other remaining issues.
Comment #73
jfhovinne commentedTo be sure this is a Debian PHP 5.4.4-something package, and not PHP 5.4.4-something on another system.
Comment #74
dawehnerThere is one, see https://github.com/composer/composer/issues/3335
Comment #75
berdirNote that as long as we still have DRUPAL_MINIMUM_PHP = 5.4.5, it is impossible to enable any modules on Debian wheezy, as that is apparently added as default php requirement for every module.
Comment #76
jfhovinne commentedYes, would be great to review and test #68, which should fix this issue.
Comment #77
cpj commentedAll of our production servers are Debian Wheezy, so this is an important issue for us. I've tested #68 both with 8.0.x and Beta-2 on a couple of these servers & a development machine also running Wheezy, and it works fine for me.
Comment #78
damien_vancouver commentedThanks to #60 I was able to install in Wheezy but then couldn't enable any modules, they all showed as needing PHP 5.4.5.
The patch from #68 worked great, now I can enable modules too.
Comment #79
webchickLooks good to me, and has also been RTBC for long enough for someone to complain. :)
Committed and pushed to 8.0.x. Thanks!
Comment #81
jhodgdonThis change in requirements needs to be documented on https://www.drupal.org/requirements -- I am not sure exactly how to document so reopening this issue.
Comment #82
basvredeling@jhodgdon see #2349969: Update all references of PHP 5.4.2 to 5.4.5 (code & docs)
Comment #83
basvredeling#2349969 has been fixed. The requirements page itself was updated too.
Comment #84
jfhovinne commentedGood news, the Debian PHP package maintainers have decided to follow the stable PHP 5.4.x releases for Wheezy, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757342 and http://www.debian.org/security/2014/dsa-3064
Debian Wheezy ships now with PHP 5.4.34, which means
DRUPAL_MINIMUM_PHP = 5.4.5should not be a problem anymore on this system.I am not sure if I should create a follow-up issue, or provide a patch here, or if a revert is still possible.
This new PHP release should also solve the Composer issue.
Patch is attached and D8 installation works on Wheezy with PHP 5.4.34.
Comment #85
catchThis is essentially a revert (although I'll probably commit the patch since the commit history here isn't super-clean), so it's fine to leave it on the same issue I think.
Patch itself looks fine, and this is a great (though ironic) resolution to the issue.
Comment #86
catchComment #87
alexpottThanks debian - php version sanity is restored! This issue is a critical task and is allowed per #2350615: [policy, no patch] What changes can be accepted during the Drupal 8 beta phase?. Committed 13aef43 and pushed to 8.0.x. Thanks!
Comment #90
yesct commented.