At the very least we should try to require PHP5.2.8 for check_plain() if it's in Debian and/or Red Hat by then.

Namespacing and lambda/enclosures make it tempting to try requiring PHP5.3. Obviously we'll have to track usage.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

arhak’s picture

-1

IMHO requiring PHP 5.3 would be a rush
too many hosting won't get there that soon
PHP 5.3 seems pretty unstable, even introducing new features like namespaces having huge changes/improvement between 5.3 minor versions

tmuras’s picture

Relates to #360605: PHP 5.3 Compatibility and #867772: Use PHP 5.3 namespaces . Among other reasons for requiring it, PHP 5.3 is now the only officially supported PHP version. Security updates are only done for PHP 5.3.

I imagine that D8 will require PHP 5.3. Can we document it and close that issue?

Dave Reid’s picture

I've already seen several web hosts switch to 5.3 as default, or offer it as an option. +1 for D8.

mfer’s picture

Title: Up PHP requirements » Increase Drupal 8 Minimum PHP version to 5.3

In my searches I did not find this issue. Updating the title to make it easier to find and use. There was some conversation on #1167160: Bump Drupal 8 Minimum PHP version to 5.3 as well.

To restate what I said there....

PHP 5.3 has been our for some time and has a number of new features that would be useful for core and contrib. PHP 5.3 adoption is on an upswing with hosts making it the default. If Drupal 8 is going to be a couple years out we could start developing in PHP 5.3 now so we are on top of technology when D8 is released.

mfer’s picture

@tmuras Drupal has a check for the minimum php version. So, there is a tiny amount of code to change on this issue.

catch’s picture

Title: Increase Drupal 8 Minimum PHP version to 5.3 » Require PHP 5.3
Priority: Normal » Major

Retitling, we need to make a decision on 5.3 or not, I can't think of any minor 5.2 versions that are relevant at the moment (check_plain() was solved with 5.2.4 in 7/8 over a year ago).

Marked #1167160: Bump Drupal 8 Minimum PHP version to 5.3 as duplicate.

I'm currently in favour of requiring 5.3 and think it's worth basing the release date on this requirement (as opposed to basing the requirement on the release date).

Regardless of any features in 5.3, there's a chance that PHP 5.4 will come out during the 8.x lifecycle. This is going to mean we may have to retrofit 5.4 support into Drupal 7, we may or may not see early 5.4 releases by the time 8.x is on its way out.

I would much rather worry about supporting two major PHP versions, especially in contrib, than three - Drupal 6 supporting PHP4 all the way through to PHP 5.3 has not been an easy path.

Bumping this to 'major' - the patch is tiny but the ramifications are large.

RobLoach’s picture

Title: Require PHP 5.3 » Increase Drupal 8 Minimum PHP version to 5.3
Priority: Major » Normal

Whoever submits the first Drupal patch with a goto in it gets a cookie.

RobLoach’s picture

Title: Increase Drupal 8 Minimum PHP version to 5.3 » Require PHP 5.3
Priority: Normal » Major

Good ol' comment module not protecting from issue status changes.

Crell’s picture

Title: Require PHP 5.3 » Increase Drupal 8 Minimum PHP version to 5.3

I am 100% in support of this move. Remember, we're looking at what the market will look like at the end of 2012 or thereabouts. By then, 5.3 should be readily available on anything capable of running Drupal in the first place.

Crell’s picture

Title: Increase Drupal 8 Minimum PHP version to 5.3 » Require PHP 5.3

Argh!

catch’s picture

I didn't actually mean to change the title from mfer's, just the original one, that was also a crosspost ;)

aspilicious’s picture

I have a very cheap host (one.com) and even they switched to php 5.3 a few months ago. (Thnx to this issue I started reading more about php 5.3, and now I'm convinced we should do this :p )

jbrown’s picture

Remember: goto should only be used as a break to a labelled destination. ;-)

droplet’s picture

2012 is the end of the world, we have to try it and release D8, LOL

tmuras’s picture

+1 for PHP 5.3 only and D8
@mfer I can look at the patch

RobLoach’s picture

Status: Active » Needs review
Issue tags: +PHP 5.3
FileSize
397 bytes
TR’s picture

+1

We already have to support 5.3, without being able to take advantages of its new features. Let's make this a D8 requirement.

Crell’s picture

Do we want 5.3.0, or one of the later releases with bug fixes?

I'd say the oldest 5.3 that's used by current stable versions of: Debian, Ubuntu, Red Hat, Suse. (Those cover the vast majority of the market.)

tmuras’s picture

I was also thinking about requiring as high as possible version of PHP 5.3.x but I think that requiring 5.3.0 is good enough. Debian for instance has 5.3.3 but this includes security patches from 5.3.4 and 5.3.5.
We should be requiring higher version only if there are some features that we would like to use. Are there?

Crell’s picture

There should be no new features in 5.3.x after 5.3.0. What there are is fewer bugs. Fewer bugs == fewer workarounds for us.

Perhaps we should commit 5.3.0 for now, and then be comfortable with bumping that requirement later if we find a bug that's fixed in 5.3.2 or some such that we don't want to have to deal with.

jbrown’s picture

I agreed with @Crell in #20.

We should require 5.3.0 so we can take advantage of new features. We can require a later 5.3 release if its absolutely necessary to fix a bug, but this should be avoided if possible to maintain maximum compatibility.

Crell’s picture

A little research from DistroWatch:

Current releases:
RHEL 6.1 (stable): PHP 5.3.3
Debian 6.0 Squeeze (stable): PHP 5.3.3
Ubuntu 11.04 (stable): PHP 5.3.5
openSUSE 11.4 (stable): 5.3.5
Mandriva 2010.2 (stable): 5.3.4
CentOS 5.6 (stable): 5.1.6
Fedora 15 (stable): 5.3.6

Old releases:
RHEL 5.6 (oldstable): PHP 5.1.6
Debian 5.0 Lenny (oldstable): PHP 5.2.6
Ubuntu 10.10 (oldstable): PHP 5.3.3
openSUSE 11.3 (oldstable): 5.3.2
Mandriva 2010.1 (oldstable): 5.3.2
Fedora 14 (oldstable): 5.3.3

Since we don't support 5.1 anyway anymore, it looks like PHP 5.3.3 would cover every current distribution. 5.3.2 would cover every current distribution and one version back (except on Debian, where Lenny is very very old anyway and using 5.2).

I'm happy with either 5.3.2 or 5.3.3 as a target.

tmuras’s picture

+1 for 5.3.2 so.

RobLoach’s picture

Status: Needs review » Needs work
Issue tags: +Novice

Anyone else want to update that patch to 5.3.2? Easy one to do.

TR’s picture

Status: Needs work » Needs review
FileSize
397 bytes

I think I can handle that :-)

Crell’s picture

Status: Needs review » Reviewed & tested by the community

Test bot approved!

Dries’s picture

Status: Reviewed & tested by the community » Fixed

This is a good one to have. Committed to 8.x.

David_Rothstein’s picture

Status: Fixed » Needs work

Patch still needs work (try running "grep -R 5\\.2 ." on a D8 checkout).

Biggest problem is probably install.php which still tells you "Drupal requires at least PHP 5.2.4", but there are others.

catch’s picture

Category: task » bug

Now it's a bug.

aspilicious’s picture

Assigned: Unassigned » aspilicious

I'm on it

aspilicious’s picture

Status: Needs work » Needs review

I put one todo in the code. (can someone give advice or reroll :) )
And this needs a review.
I'm wondering if this broke something...

aspilicious’s picture

forgot patch

aspilicious’s picture

Assigned: aspilicious » Unassigned

Status: Needs review » Needs work

The last submitted patch, 576508-php-5-3-upgrade-31.patch, failed testing.

aspilicious’s picture

Status: Needs work » Needs review
FileSize
5.88 KB

Lets try again

amateescu’s picture

Status: Needs review » Needs work
+++ b/install.php
@@ -16,8 +16,8 @@
+if (version_compare(PHP_VERSION, '5.3.2') < 0) {
+  print 'Your PHP installation is too old. Drupal requires at least PHP 5.3.2. See the <a href="http://drupal.org/requirements">system requirements</a> page for more information.';
   exit;
 }

Shouldn't we use DRUPAL_MINIMUM_PHP here?

Something like:

+if (version_compare(PHP_VERSION, DRUPAL_MINIMUM_PHP) < 0) {
+  print 'Your PHP installation is too old. Drupal requires at least PHP ' . DRUPAL_MINIMUM_PHP . '. See the <a href="http://drupal.org/requirements">system requirements</a> page for more information.';
   exit;
 }

Powered by Dreditor.

jbrown’s picture

Status: Needs work » Needs review

DRUPAL_MINIMUM_PHP isn't available that early.

David_Rothstein’s picture

To make it available we'd need to include bootstrap.inc, which (last time someone checked, at least) causes a parse error in PHP 4... see #722974-10: Install script returns a blank page for PHP4, PHP 5.1 (should display *something* instead)

Might be worth adding this fact to the code comment in install.php. (Or we could just decide to let PHP 4 users whitescreen by the time Drupal 8 comes around, but I'm not sure that's a good idea, and anyway, it's a different issue.)

jbrown’s picture

FileSize
7.55 KB

Updated patch.

Performed the TODO in authorize_get_filetransfer()
Tidied up drupal_error_levels()
Added a comment to install.php per #38

sun’s picture

Category: bug » feature

Bug report??

catch’s picture

Sun, it's a bug now because the installer tells you to use 5.2 when it now actually requires 5.3.

catch’s picture

Category: feature » bug

Moving back. It'd be good if we could start just rolling back patches when they're immediately found to introduce bugs then it wouldn't put the bug count higher.

David_Rothstein’s picture

Patch looks good on a visual review (I haven't tested it though). One minor typo:

+// The minimum version is specified explicity, as DRUPAL_MINIMUM_PHP is not yet

Should be "explicitly".

jbrown’s picture

FileSize
7.55 KB
David_Rothstein’s picture

Status: Needs review » Reviewed & tested by the community

I only tested one or two parts of this directly, but the testbot says the whole thing is good and the patch itself looks very straightforward, so I'm marking it RTBC.

andypost’s picture

While PHP 5.3 is requirement there's a great ability to cleanup D8 codebase to make it compatible with True FastCGI support introduced.
Is there any issue / post at g.d.o about making Drupal compatible with FastCGI?

This ability could be illustrated with

Framework::init();
while($request = FastCGI::accept()) {
  // Process request
}
Framework::shutdown();
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed #44 to Drupal 8. Thanks for the rigor, David.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rfay’s picture

Status: Closed (fixed) » Needs work
Issue tags: +Needs documentation

Unfortunately this is the error message:

Your PHP installation is too old. Drupal requires at least PHP 5.3.2. See the system requirements page for more information.

However, http://drupal.org/requirements says:

PHP:
Drupal 5 and 6: 4.4.0 or higher (5.2 recommended)
Drupal 7: PHP 5.2.5 or higher (5.3 recommended)

rfay’s picture

I updated http://drupal.org/requirements just in that one place. This is a pretty major change, and caught me by surprise. Are there other places that we should be fixing docs? Wouldn't this be called something like a major API change in midstream?

rfay’s picture

Status: Needs work » Closed (fixed)
Issue tags: -Needs documentation

Sorry, I'm just lost. I fooled myself checking out 8.x

webchick’s picture

A note that the requirements were raised to PHP 5.3.3 as of #1321540: Convert DBTNG to namespaces; separate Drupal bits.

Jelle_S’s picture

Status: Closed (fixed) » Needs work

By now it seems that PHP 5.3.4 is required because of Drupal\field\FieldInstance

It implements ArrayAccess. The reason it needs PHP 5.3.4 is that FieldInstance has the offsetGet method implemented as returning by reference.

From the php website:

Note:

Starting with PHP 5.3.4, the prototype checks were relaxed and it's possible for implementations of this method to return by reference. This makes indirect modifications to the overloaded array dimensions of ArrayAccess objects possible.

A direct modification is one that replaces completely the value of the array dimension, as in $obj[6] = 7. An indirect modification, on the other hand, only changes part of the dimension, or attempts to assign the dimension by reference to another variable, as in $obj[6][7] = 7 or $var =& $obj[6]. Increments with ++ and decrements with -- are also implemented in a way that requires indirect modification.

While direct modification triggers a call to ArrayAccess::offsetSet(), indirect modification triggers a call to ArrayAccess::offsetGet(). In that case, the implementation of ArrayAccess::offsetGet() must be able to return by reference, otherwise an E_NOTICE message is raised.

This means the requirement should be updated (and I need to get my php version up to date)

catch’s picture

Status: Needs work » Closed (fixed)

See #1751100: Bump minimum version of php required to 5.3.5. Unfortunately you caught the window between the new code being added and the requirement itself being bumped, but I didn't want to completely prevent people from installing without any warning.

Jelle_S’s picture

Ah what a chance xD, thanks for the link ;-)

andypost’s picture

Status: Closed (fixed) » Needs work

Probably we could make it upper if sorting bug will be fixed https://bugs.php.net/bug.php?id=50688
This required for sorting configuration entities

catch’s picture

Status: Needs work » Closed (fixed)

Let's stick to the current issue.

catch’s picture

Let's stick to the current issue.