Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backdrop does not run on PHP 5.3.3 (or PHP 5.3.2?) #4712

Closed
jenlampton opened this issue Oct 19, 2020 · 13 comments
Closed

Backdrop does not run on PHP 5.3.3 (or PHP 5.3.2?) #4712

jenlampton opened this issue Oct 19, 2020 · 13 comments

Comments

@jenlampton
Copy link
Member

jenlampton commented Oct 19, 2020

Description of the bug

In the requirements section on bakdropcms.org we clearly state that you need to be running PHP 5.3.2 or higher to run Backdrop.

I have a server running two Drupal 7 sites (and a Drupal 6 site, but sshhh) that is on 5.3.3 that cannot run Backdrop.

I get the following fatal error when trying to log in:

Fatal error: Can't inherit abstract function UserInterface::id() (previously declared abstract in EntityInterface) in backdrop/core/modules/user/user.entity.inc on line 10

Steps To Reproduce

To reproduce the behavior:

  1. Find an old server running PHP 5.3.3 (preferably, one that runs Drupal 7 with no issues)
  2. Import working database + config + code from Backdrop 1.17.x site
  3. Attempt to log in

Actual behavior

fatal errors

Expected behavior

things should work.

Add any other information that could help, such as:

  • Backdrop CMS version: 1.17.1
  • Web server and its version: nginx version: nginx/1.10.2
  • Operating System and its version: CentOS release 6.9 (Final)
@jenlampton jenlampton changed the title Backdrop does not run on PHP 5.3.2 or PHP 5.3.3 Backdrop does not run on PHP 5.3.3 (or PHP 5.3.2?) Oct 19, 2020
@indigoxela
Copy link
Member

Hm... If this is the first time someone actually realized this problem, then it's very likely a really rare one... 😉

@jenlampton In theory php version 5.3.9 could handle that code, but updating the requirements info is probably not what you want. And updating php on your CentOS server is probably impossible, too.

Anyway, I can't test/verify nor provide a PR as the oldest php version I can get on my dev is 5.6.40. And this very likely is the case for most of us.

BTW: our 5.3 testboxes have 5.3.29.

@jenlampton
Copy link
Member Author

Hm... If this is the first time someone actually realized this problem, then it's very likely a really rare one

It's possible that someone had realized the problem but gave up on Backdrop immediately and then didn't bother to tell us. I suspect though, that this is a rare problem.

I am tempted to move these sites to a newer server for the client, but I also want to use this server as a testing ground for Backdrop...

Is it possible to rework the code so that it can run on PHP 5.3.2 or higher, or is that a lost cause at this point? If a lost cause, we should update the documentation to match reality. (and close this issue)

@indigoxela
Copy link
Member

Is it possible to rework the code so that it can run on PHP 5.3.2 or higher, or is that a lost cause at this point?

It's very likely possible, but who could provide a PR? Does anyone still have such an oooold php available in a dev box? Or maybe the question should be: is anyone willing to spend time on it?

If a lost cause, we should update the documentation to match reality.

Backdrop supports 5.3.29 - the testboxes prove it. Anything older would be hard to verify, even 5.3.9 - which should have fixed that php bug.

Note: many of the 5.3 releases after 5.3.2 have been security releases. It's not recommended to run anything on such an old and insecure php version. At least not if it's "in the internet".

@jenlampton
Copy link
Member Author

Does anyone still have such an oooold php available in a dev box?

Well, I do, apparently :)

Does anyone still have such an oooold php available in a dev box?

Surely docker can do this?

It's not recommended to run anything on such an old and insecure php version

I expect that there are a lot of sites that were built, launched, and have been "working fine" ever since, with little thought toward maintenance. In my case, the Drupal 6 site is still doing it's intended job well.

@stpaultim
Copy link
Member

Note: many of the 5.3 releases after 5.3.2 have been security releases. It's not recommended to run anything on such an old and insecure php version. At least not if it's "in the internet".

I appreciate that it's not recommended. But, if our documentation says that we support 5.3.2 or higher, then we should support it. I assume that this is a policy decision that we took at some point and that there are reasons behind it.

What is very cool, is that we will (at lease we should) soon have telemetry data to give us some idea of what versions of PHP our users are using.

@klonos
Copy link
Member

klonos commented Jan 17, 2021

Lando configured with php: '5.3' installs 5.3.29 (although many errors - some re composer, some re drush) ...anyway, I can get Backdrop installed manually in php 5.3.29, but the goal is to get 5.3.2 installed. Perhaps @serundeputy can help with a .lando.yml example that gets us 5.3.2?

@jayelless jayelless self-assigned this Aug 26, 2021
@jayelless
Copy link

jayelless commented Aug 27, 2021

I created a VirtualBox VM and installed Ubuntu 10.04 which came with PHP 5.3.2, so I could test backdrop in this envirpnment.

I found several problems:

  1. When initiating an install of a new site, the first screen to choose the language gives the error:
    Warning: Parameter 1 to array_multisort() expected to be a reference, value given in backdrop_sort() (line 7323 of /home/james/websites/backdrop/core/includes/common.inc).
    This is caused by a line of code call_user_func_array('array_multisort', $param); which is simple enough to refactor to a direct call to the array_multisort inbuilt function.

  2. The javascript used to drive the install process does not work, so the screen showing progress on module installation stays sitting on "Initiaizing" at 0%. The screen can be refreshed to show progress, up to the point it reaches 100%, then the installation does not move on from "op=start", so configuring the system cannot be achieved.

  3. However, once the modules have all been installed, a browser pointed to the site will generate the error specified by @jenlampton . This is caused by a PHP bug relating to inheritability of abstract methods (refer https://bugs.php.net/bug.php?id=63384) as the method id() is defined in
    class User extends Entity implements UserInterface and also in both "interface UserInterface" and "interface EntityInterface" which is inherited by "abstract Class Entity implements EntityInterface". This error (along with similar ones that could occur for methods "label()" and "uri()") can be resolved by removing the "abstract" declaration for class Entity and implementing the methods in that class as required by the interface.

Overall, I suggest that the problems are such and any changes required to resolve them are potentially too significant to continue to pursue getting Backdrop working on Php5.3.2. I have not tested it with 5.3.9, which was suggested as likely to work.

@indigoxela
Copy link
Member

indigoxela commented Aug 27, 2021

We do know for sure, that Backdrop runs on PHP 5.3.29 - as the functional tests run on that version.

I agree, getting this working on a ancient version is a waste of time. Version 5.3.29 is the last update for 5.3. We can verify, that things work on it without extra effort, so I suggest to update the requirements info accordingly.

(Not that I'd recommend anyone to stay on hosting that uses such an old version, as the provider obviously doesn't bother security updates. 😜 )

BTW: CentOS 6 is EOL since November 30, 2020.

@jayelless
Copy link

Thanks @indigoxela.

@jenlampton If you want a custom patch that you can apply to the environment you specified in your original post, then I would be happy to prepare that. I could pull a copy of backdrop 1.17.1 and load an existing database and patch so that it runs Ok on the Php5.3.2 configuration. This would allow time to migrate to a later supported version. Let me know if that interest you.

@jenlampton
Copy link
Member Author

jenlampton commented Aug 27, 2021

@jayelless wow, thanks! I don't think I need the patch anymore, I've since moved this particular Backdrop site to Pantheon.

I agree, getting this working on a ancient version is a waste of time. Version 5.3.29 is the last update for 5.3. We can verify, that things work on it without extra effort, so I suggest to update the requirements info accordingly.

I agree, updating our minimum PHP version to the minimum version we test seems reasonable :) I'll make the change.

@jenlampton
Copy link
Member Author

jenlampton commented Oct 23, 2021

For the record, I had previously increased the minimum PHP version in our requirements section to 5.3.29 (from PHP 5.3.2) on the system requirements page:
https://docs.backdropcms.org/documentation/system-requirements

In Drupal 7's README.txt file, the minimum supported PHP version is listed as PHP 5.2.4 (or greater) (http://www.php.net/).

However, As of Drupal 7.62, the minimum secure requirements as governed by the drupal community were increased to PHP 5.3.3. See SA-CORE-2019-002.

I think it would be reasonable to bump our minimum version to PHP 5.3.3.

@indigoxela
Copy link
Member

After the immediate problem here (website on ancient php) has been solved, this issue seems to overlap a lot with #3992

Could it make sense to close this one, and continue discussion re requirement changes in the other issue?

@quicksketch
Copy link
Member

quicksketch commented Jan 2, 2022

This is now a moot issue as we're bumping the minimum version to 5.6 in #3992. I don't think it makes sense for us to cause confusion by bumping the version number twice; which may lead to people thinking that newer versions of 5.3 (or anything below 5.6) is going to be sufficient.

I don't believe there is anything we should do here, so I think it makes sense to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants