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

Composer & PHP versions? #104

Open
akgerber opened this issue Mar 8, 2021 · 0 comments
Open

Composer & PHP versions? #104

akgerber opened this issue Mar 8, 2021 · 0 comments

Comments

@akgerber
Copy link

akgerber commented Mar 8, 2021

I'm trying to follow the README on MacOS 11.2.2.

The default PHP version installed appears to be 7.3.4:

➜  php --version
WARNING: PHP is not recommended
PHP is included in macOS for compatibility with legacy software.
Future versions of macOS will not include PHP.
PHP 7.3.24-(to be removed in future macOS) (cli) (built: Dec 21 2020 21:33:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies

When installing composer with Homebrew, it appears the latest version is 2.0.11 which appears to break some interfaces.

(base) ➜  vanilla git:(master) ✗ composer --version
Composer version 2.0.11 2021-02-24 14:57:23

Attempting to use these versions causes issues with step 11 in the README, namely that it appears the composer.json is not compatible with Composer 2.x:

(base) ➜  vanilla git:(master) ✗ composer install
The "metasyntactical/composer-plugin-license-check" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "wikimedia/composer-merge-plugin" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
> Vanilla\Setup\ComposerHelper::preUpdate
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - metasyntactical/composer-plugin-license-check is locked to version v0.5.0 and an update of this package was not requested.
    - metasyntactical/composer-plugin-license-check v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 2
    - wikimedia/composer-merge-plugin is locked to version v1.4.1 and an update of this package was not requested.
    - wikimedia/composer-merge-plugin v1.4.1 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 3
    - vanilla/garden-jsont is locked to version v1.2 and an update of this package was not requested.
    - You can only install one version of a package, so only one of these can be installed: vanilla/garden-jsont[v1.2].

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

Attempting to work around this issue by running the latest Composer 1.x installed via php composer-setup.php --version 1.10.20 runs into this issue with default MacOS PHP:

(base) ➜  vanilla git:(master) ✗ /usr/bin/php composer.phar install
> Vanilla\Setup\ComposerHelper::preUpdate
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested PHP extension ext-intl * is missing from your system. Install or enable PHP's intl extension.

I was able to resolve this issue by installing PHP7.4 via brew install [email protected] and brew link [email protected] and starting a new terminal to use the newer PHP:

php composer.phar install

This also fails, but pretty deep into the install process so I will fail a separate issue for the problem encountered.

Can specific versions of PHP & Composer be suggested in the README to avoid these issues?

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

No branches or pull requests

1 participant