Skip to content

composer install fails with php 5.6 and composer 2.2 #45

Closed

Description

@toddr

Bug Report

Describe the current, buggy behavior

The dependence on "johnpbloch/wordpress-core": "dev-master" is now failing on PHP 5.6, which I understand is still supposed to be supported.

Describe how other contributors can replicate this bug

  • make your PHP 5.6
  • use composer 2.2 (so 5.6 is supported)
  • clone wp-cli-dev
  • composer install.

The error is:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires johnpbloch/wordpress-core dev-master -> satisfiable by johnpbloch/wordpress-core[dev-master].
    - johnpbloch/wordpress-core dev-master requires php >=7.0.0 -> your php version (5.6.40) does not satisfy that requirement.

Describe what you would expect as the correct outcome

It should succed

Let us know what environment you are running this on

OS:	Linux toddr-cl8.dev.cpanel.net 4.18.0-477.13.1.lve.1.el8.x86_64 #1 SMP Mon Jul 17 15:05:09 EDT 2023 x86_64
Shell:	/usr/bin/zsh
PHP binary:	/home/cli/bin/php
PHP version:	5.6.40
php.ini used:	/opt/cpanel/ea-php56/root/etc/php.ini
MySQL binary:	/usr/bin/mysql
MySQL version:	mysql  Ver 8.0.34 for Linux on x86_64 (MySQL Community Server - GPL)
SQL modes:	
WP-CLI root dir:	/home/cli/wp-cli-dev/wp-cli
WP-CLI vendor dir:	/home/cli/wp-cli-dev/wp-cli/vendor
WP_CLI phar path:	
WP-CLI packages dir:	
WP-CLI cache dir:	/home/cli/.wp-cli/cache
WP-CLI global config:	
WP-CLI project config:	/home/cli/wp-cli-dev/wp-cli.yml
WP-CLI version:	2.9.0-alpha

Provide a possible solution

I think this is the fix but I don't know enough about composer.json to be sure.

diff --git a/composer.json b/composer.json
index 5e6784c..a787647 100644
--- a/composer.json
+++ b/composer.json
@@ -239,7 +239,7 @@
         "wp-cli/wp-config-transformer": "dev-main as 1.2.x-dev",
         "wp-cli/wp-super-cache-cli": "dev-main",
         "johnpbloch/wordpress-core-installer": "^1.0 || ^2.0",
-        "johnpbloch/wordpress-core": "dev-master"
+        "johnpbloch/wordpress-core": "~6"
     },
     "require-dev": {
         "roave/security-advisories": "dev-latest"

Activity

  1. danielbachhuber commented on Aug 28, 2023

    @danielbachhuber
    Member

    The dependence on "johnpbloch/wordpress-core": "dev-master" is now failing on PHP 5.6, which I understand is still supposed to be supported.

    It looks like the minimum supported PHP version was recently updated: johnpbloch/wordpress@d3b0895

    johnpbloch/wordpress-core was added as a dependency here: 22e0d23

    We've had to do a ton of PRs like wp-cli/wp-config-transformer#42

    In honesty, I'm not actually sure what it's used for. @wp-cli/committers Anyone know?

  2. swissspidy commented on Oct 31, 2023

    @swissspidy
    Member

    In honesty, I'm not actually sure what it's used for. @wp-cli/committers Anyone know?

    No idea. @schlessera any insights?

  3. mrsdizzie commented on Feb 14, 2025

    @mrsdizzie
    Member

    This has gotten worse

      Problem 1
        - Root composer.json requires wp-cli/dist-archive-command dev-main -> satisfiable by wp-cli/dist-archive-command[dev-main].
        - wp-cli/dist-archive-command dev-main requires php >=7.4 -> your php version (5.6.40) does not satisfy that requirement.
      Problem 2
        - Root composer.json requires johnpbloch/wordpress-core dev-master -> satisfiable by johnpbloch/wordpress-core[dev-master].
        - johnpbloch/wordpress-core dev-master requires php >=7.2.24 -> your php version (5.6.40) does not satisfy that requirement.
      Problem 3
        - symfony/process[v4.0.0-BETA1, ..., v4.4.10] require php ^7.1.3 -> your php version (5.6.40) does not satisfy that requirement.
        - symfony/process[v4.4.11, ..., 4.4.x-dev] require php >=7.1.3 -> your php version (5.6.40) does not satisfy that requirement.
        - symfony/process[v5.0.0-BETA1, ..., v5.0.0-RC1] require php ^7.2.9 -> your php version (5.6.40) does not satisfy that requirement.
        - symfony/process[v5.0.0, ..., v5.1.0-RC1] require php ^7.2.5 -> your php version (5.6.40) does not satisfy that requirement.
        - symfony/process[v5.0.9, ..., 5.4.x-dev] require php >=7.2.5 -> your php version (5.6.40) does not satisfy that requirement.
        - symfony/process[v6.0.0-BETA1, ..., 6.0.x-dev] require php >=8.0.2 -> your php version (5.6.40) does not satisfy that requirement.
        - symfony/process[v6.1.0-BETA1, ..., 6.4.x-dev] require php >=8.1 -> your php version (5.6.40) does not satisfy that requirement.
        - composer/composer[2.3.0-RC1, ..., 2.8.x-dev] require php ^7.2.5 || ^8.0 -> your php version (5.6.40) does not satisfy that requirement.
        - Root composer.json requires wp-cli/package-command dev-main -> satisfiable by wp-cli/package-command[dev-main].
        - wp-cli/package-command dev-main requires composer/composer ^1.10.23 || ^2.2.17 -> satisfiable by composer/composer[1.10.23, ..., 1.10.x-dev, 2.2.17, ..., 2.8.x-dev].
        - composer/composer[2.2.24, ..., 2.2.x-dev] require symfony/process ^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0 -> satisfiable by symfony/process[v2.8.52, 2.8.x-dev, v3.4.35, ..., 3.4.x-dev, v4.4.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev, v6.0.0-BETA1, ..., 6.4.x-dev].
        - composer/composer[1.10.27, ..., 1.10.x-dev] require symfony/process ^2.7 || ^3.0 || ^4.0 || ^5.0 -> satisfiable by symfony/process[v2.7.0-BETA1, ..., 2.8.x-dev, v3.0.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev, v5.0.0-BETA1, ..., 5.4.x-dev].
        - roave/security-advisories dev-latest conflicts with composer/composer 2.2.23.
        - roave/security-advisories dev-latest conflicts with composer/composer 1.10.26.
        - roave/security-advisories dev-latest conflicts with symfony/process v3.4.47.
        - roave/security-advisories dev-latest conflicts with symfony/process v3.3.6.
        - roave/security-advisories dev-latest conflicts with symfony/process v3.2.14.
        - roave/security-advisories dev-latest conflicts with symfony/process v2.8.52.
        - Root composer.json requires roave/security-advisories dev-latest -> satisfiable by roave/security-advisories[dev-latest].
    
    mrsdizzie.com@web09 ~/wp-cli-dev (main|u=) $ composer -v
    
       ______
      / ____/___  ____ ___  ____  ____  ________  _____
     / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
    / /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
    \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                        /_/
    Composer version 2.2.25 2024-12-11 11:58:02
    
    mrsdizzie.com@web09 ~/wp-cli-dev (main|u=) $ php -v
    PHP 5.6.40 (cli) (built: Jan  6 2021 18:52:21)
    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
    

    I wanted to address a test failure on PHP 5.6 / WP 3.7 but it is not easy : ) It seems now even our own requirements (from dist-archive-command) limit this to PHP 7.4

  4. swissspidy commented on Feb 14, 2025

    @swissspidy
    Member

    The symfony/process one is also tracked here: wp-cli/wp-cli#6018

    We'll probably bump the PHP requirement at some point this year, but I understand it's still frustrating in the meantime. Running composer install with --ignore-platform-reqs should help though.

    As for the johnpbloch/wordpress-core one, I have no idea what this is used for. Maybe just to have quick access to WP files? 🤷

    I think we can remove that one and if something breaks we'll learn about it sooner or later.

  5. swissspidy commented on Aug 25, 2025

    @swissspidy
    Member

    Closing for now since we bumped the requirements recently.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingscope:testingRelated to testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions