Closed (works as designed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
install system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Aug 2012 at 08:45 UTC
Updated:
29 Jul 2014 at 21:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gtoffoli commentedThe problem is that index.php contains 5.3 syntax (use keyword), the solution could be to make index.php 5.2.x compatible and isolate the 5.3 code in a different file eventually included but not immediately parsed, something like:
index2.php (terrible name, I know) would contain what index.php was containing:
Comment #2
ken hawkins commentedI can't think of any other workaround, and I'm sure a lot of folks will hit this screen as they try to put D8 on servers they've been using for 6 and 7.
Going with your method, perhaps it would be cleaner looking to isolate only the offending selectors.
So, index.php:
And then usefunctions.php is only
Just to confirm, this method works as expected reporting PHP 5.3 failure — example: http://allaboutken.com/d8/
Comment #3
valthebaldAttached is a proof of concept
1. index.php moved to core/index.php
2. definition of DRUPAL_ROOT moved to the newly created index.php
3. index.php contains PHP5.2-compatible version check, then includes core/index.php
Comment #4
ken hawkins commentedLooks good to me.
Works fine with 5.3+, fails with 5.2.
I might be a bit a bold in marking this as tested ... but somewhere I think it says to be bold on d.o ...
Comment #5
chx commentedPHP 5.2 is EOL. Dead. It has ceased to be. Bereft of life. If you were to patch install.php, I could see the merits of doing that, but adding more to early bootstrap to every single Drupal page load on millions of sites just because there are a few slackers who run PHP 5.2 in 2013 (when we release)? We have debated hard adding a filemtime call, not to mention adding a full new file and including that.
Comment #6
valthebaldThen why "needs work" instead of "won't fix"?
Comment #7
chx commentedBecause we can patch install.php. The issue is titled "PHP 5.3 detection fails on install" and THAT is something we can fix. You can add an install.php to sit besides index.php to do this detection and instruct people to visit it. For non-documentation-reading people with 5.3 , just going to index.php will stay working.
Comment #8
valthebaldcore/install.php already contains this check, which happens before install_drupal() call,
install.php is redirected to core/install.php by .htacess, no matter if it exists (which is a separate issue - do we need
RewriteCond %{REQUEST_FILENAME} !-fwhile making install/update.php redirects? But this is, in any case, a separate issue)
If making index.php PHP5.2-compatible is not an option, then all other ingredients are in place.
Comment #9
ken hawkins commentedTwo pieces of food for thought:
So that's something around 70% or more of websites that would see a WSOD when trying to upgrade to D8 today. And in mid-2013 it could easily be around 35%.
This is also a documentation issue as INSTALL.txt does not tell users to load install.php but rather the document root:
I think it's reasonable to expect that most users will read some documentation, but those users must first open readme.txt, that then refers them to install.txt to even see that PHP 5.3.3 is required.
Comment #10
chx commentedI would suspect that number is misleading -- HostGator for example (I refuse to even research godaddy) has 5.2 and 5.3 both and so you'd see a huge number of 5.2 sites while your host already has 5.3. Also, don't forget that 06-Jan-2011 was the last ever 5.2 release.
On the other hand, the second half of your claim makes me wonder -- why don't we patch update.php? That would not be on a performance critical path and would work just fine.
Also, I see people are really passoinate about this, so I have thought on this more and here is an idea: move the contents of index.php into bootstrap.inc into a function and call that as appropriate. This will allow you to run a version check in index.php -- I am not against that; I am against a new file include. But bootstrap.inc is already loaded so why not?
Comment #11
chx commentedAlso (maybe in a separate issue?) https://www.google.com/search?complete=0&q=AddHandler+application%2Fx-ht... we should add AddHandler application/x-httpd-php53 .php to .htaccess and also AddHandler x-httpd-php5-3 .php and it'll help a real lot of shared hosts.
Comment #12
catchI'm not prepared to put PHP version checks in index.php, fine with doing that for update.php though if it's not there already.
Comment #13
chx commentedWhy not...? a version compare is very very minimal, it wont make Drupal slowre.
Comment #14
catchIt's not about the performance, it'd be about a 10% increase in the lines of code in index.php (or nearly all of index.php if we moved the rest to a function), and there's still likely a year before Drupal 8 actually releases, by which time we have no idea how many hosts will still be on PHP 5.2.
Comment #15
chx commentedWell, then I propose to fix update and someone should file another issue with those htaccess lines I found which should solve this problem for most shared hosts.
Comment #16
-enzo- commentedHello folks
I just did an implementation to enable run the update.php using prior version of PHP 5.3 , without get a horrible message.
Basically I just move all functions and references to namespaces function to a new file core/includes/update.core.inc and then simplify the core/update.php.
Tested with PHP 5.2 and PHP 5.3.
But at the end I got this error:
Reported in issue http://drupal.org/node/1464554#comment-6204906
As chx mentioned, a change is required in .htacess file, but maybe this change must be addressed in other issue.
Comment #17
valthebald.htaccess change is a separate issue
Comment #18
-enzo- commentedValthebald if is a separate issue why you set the status to needs works? I need to know just to understand what is the criteria.
Comment #19
chx commentedThis is just moving code around, the error mentioned is a separate error, and this is good.
Comment #20
xjmThere's an older issue about this: #1468340: index.php has syntax error instead of graceful fail for < 5.3 (It was originally about all three entry points).
Comment #21
xjmSorry, xpost.
Comment #22
-enzo- commentedMaybe you can put the other issue as resolved by this ticket?
Comment #23
xjmWell, the other issue has broader scope, so no. :) But I did reference this issue there.
Comment #24
-enzo- commentedIf the patch in comment 16 is consider to apply in drupal 8 core, I will really appretiate if you use my git authoring information for attribution.
--author="enzo <enzo@294937.no-reply.drupal.org>"Comment #25
catch#16: drupal-1749790-improve_update_to_handle_requests_using_prior_versions_PHP_53-16.patch queued for re-testing.
Comment #26
catch@-enzo- we don't use
--authorfor core commits for various reasons, some of this is discussed at #1717676: Core commit credit and log messages are inconsistent between patches and merges. Patch no longer applies and could use a re-roll.Comment #27
-enzo- commentedJust let me know when you applied the patch, If you apply the patch, is enough for me known I contribute with a small piece of code to Drupal 8.
I understand the current process to provide credits needs some improvements.
About the test, can you give any guidance to understand why the test fail? I don't understand why now fail last week the test pass all checks.
Comment #28
catchThe test fails because since the patch was created, the code it touches no longer applies. If you apply the patch locally with p1, or git pull --rebase on your git branch you'll see the conflicts.
Comment #29
-enzo- commentedHey guys I did a re-roll of patch #16.
Comment #30
-enzo- commentedHey guys I did a re-roll of patch #16. Patch re-uploaded, last one had an error.
Comment #31
mgifford#30: drupal-1749790-improve_update_to_handle_requests_using_prior_versions_PHP_53-30.patch queued for re-testing.
Comment #33
tstoecklerDRUPAL_MINIMUM_PHP is 5.3.10 by now.
Comment #34
valthebald#33: this issue is about detecting incompatible PHP version during install/upgrade, not on every request
Comment #35
tstoecklerSorry for not explaining that comment properly. I meant that the patch still uses 5.3.3 as the version to compare against. (It cannot use DRUPAL_MINIMUM_PHP directly per the comment in the patch.)
This is what I meant.
Comment #36
berdirI think this is no longer relevant as we no longer support major upgrades.
Comment #37
klonos...actually.