-
Notifications
You must be signed in to change notification settings - Fork 395
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
Revert back to requiring php 5.6 as the minimum php version #2665
Changes from all commits
2c8d8c0
01307a0
4791b66
0e4ceff
5300d43
cf4c984
76d4d85
7620008
06435a5
42ffa86
146c737
290e2e1
aa4ece4
b689763
3de1144
eb64dbb
be8c60d
522ed4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ version: 1.1.0 | |
services: | ||
- mysql | ||
- php: | ||
version: 7.1 | ||
version: 5.6 | ||
|
||
variables: | ||
global: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -788,7 +788,7 @@ public function issueEnvironmentWarnings($command_name) { | |
* @throws \Acquia\Blt\Robo\Exceptions\BltException | ||
*/ | ||
public function warnIfPhpOutdated() { | ||
$minimum_php_version = 7; | ||
$minimum_php_version = 5.6; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not keep a warning in here, but don't throw an exception? Maybe suggest users to move off 5.6 at their convenience... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or, have a warning and suggest users move to 5.6 if they really need it, but not encourage it as a default. Otherwise, this entire issue feels like a step backwards. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is not currently a warning but rather an exception, causing BLT to fail. I agree -- giving some warning that you're running 5.6 would be good, although Drupal already does that. |
||
$current_php_version = phpversion(); | ||
if ($current_php_version < $minimum_php_version) { | ||
throw new BltException("BLT requires PHP $minimum_php_version or greater. You are using $current_php_version."); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geerlingguy Are more changes than this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No not for the VM... but do we really want to default to 5.6? Shouldn’t we default to whatever Acquia Cloud currently defaults to (7.1 IIRC)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trouble is that if your host is 5.6 and your VM is 7, you get some issues with Composer. Maybe we should look into defaulting the "config" in composer.json to PHP 7. I know that adding it to
template/composer.json
andcomposer.required.json
do not work. We'd need to actually modify the generatedcomposer.json
after project creation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually run 5.6 on host and 7 in VM. TBH, I haven't really had a problem with it... I usually run
$ composer
commands on the host, and BLT will run composer in the VM... knock on wood but I haven't seen much yet. Just wanted to share... ha.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you use the platform config setting in composer.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most people I've seen (including myself) run a higher PHP version on the host than the VM. i.e. 7.2 on the host, and 5.6 or 7.1 in the VM. The reason being pretty obvious, that the VM replicates an Acquia Cloud or other hosting environment that generally lags behind general desktop software in terms of PHP releases.
I'd really like to see the VM default to the highest version possible in order to match the host machine, or at least never be "behind" the host, which leads to some nasty problems. For instance, running
composer update
on the host breaks everything by pulling in 7.1 dependencies that won't run in the VM.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't. I mean, below is my output, haha. I haven't upgraded my host b/c I've just been lazy, TBH, and I haven't seen a need to. I do a lot of composer updates for our project too, and just haven't run into any issues...
If you need me to try anything out, LMK - I'm happy to report back.
$ php -v PHP 5.6.31 (cli) (built: Aug 17 2017 16:41:40) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies with Xdebug v2.5.3, Copyright (c) 2002-2017, by Derick Rethans $ vagrant ssh -c 'php -v' PHP 7.0.20-2~ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 14 2017 05:33:01) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.20-2~ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe b/c my VM is 7.0 instead of 7.1? I really need to update both my host and my guest, haha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm IMHO, except for grabbing the initial code you really should never run composer on the host environment. The part that matters here is that your VM matches your Production environment. If I could have my host not have ANY dev tools (php, drush, composer, etc) I would.
While Acquia Cloud -defaults- to 7.1 for new instances, it certainly isn't what most of our clients are running. And until ACE+ACSF are fully off 5.6, we shouldn't be shipping a VM that can break prod.. which is the whole point of Vagrant in the first place. Since 7.0 much more backwards compatible with 5.6 than visa-versa, we need to use the least common denominator.