php 8 compatibility

Created on 26 October 2023, about 1 year ago
Updated 4 April 2024, 10 months ago

Problem/Motivation

I am using PHP 8.2 in my local and when i am trying to install the module, i am geting the following error:

 Problem 1
    - geocoder-php/common-http[4.1.0, ..., 4.2.0] require php ^7.0 -> your php version (8.2.0) does not satisfy that requirement.
    - geocoder-php/nominatim-provider[5.0.0, ..., 5.1.1] require php ^7.0 -> your php version (8.2.0) does not satisfy that requirement.
    - geocoder-php/common-http 4.3.0 requires php ^7.2 -> your php version (8.2.0) does not satisfy that requirement.
    - geocoder-php/nominatim-provider[5.2.0, ..., 5.3.0] require php ^7.2 -> your php version (8.2.0) does not satisfy that requirement.
    - geocoder-php/common-http[4.4.0, ..., 4.5.0] require psr/http-message ^1.0 -> found psr/http-message[1.0, 1.0.1, 1.1] but the package is fixed to 2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/cloud dev-6.x requires geocoder-php/nominatim-provider ^5 -> satisfiable by geocoder-php/nominatim-provider[5.0.0, ..., 5.7.0].
    - drupal/cloud 6.x-dev is an alias of drupal/cloud dev-6.x and thus requires it to be installed too.
    - geocoder-php/nominatim-provider[5.4.0, ..., 5.7.0] require geocoder-php/common-http ^4.1 -> satisfiable by geocoder-php/common-http[4.1.0, ..., 4.5.0].
    - Root composer.json requires drupal/cloud 6.x-dev@dev -> satisfiable by drupal/cloud[6.x-dev (alias of dev-6.x)].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

and if we downgrade the php, if there are other module's which is depends on > php 8.0 it won't work.

Steps to reproduce

Install the module on PHP > 8 environment

🐛 Bug report
Status

Active

Version

6.0

Component

Code

Created by

🇮🇳India mukhtarm

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mukhtarm
  • Assigned to shiv_yadav
  • Issue was unassigned.
  • 🇯🇵Japan xiaohua guan Tokyo, Japan

    @shiv_yadav

    The error is caused by psr/http-message. If you downgrade the version of the package from 2.0 to 1.1, I think the cloud module can be installed.

  • 🇮🇳India mukhtarm

    I don't have psr/http-message package listed in my composer.json in D10. Although i could see an entry in the composer.lock as follows:

    {
                "name": "psr/http-client",
                "version": "1.0.3",
                "source": {
                    "type": "git",
                    "url": "https://github.com/php-fig/http-client.git",
                    "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
                },
                "dist": {
                    "type": "zip",
                    "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
                    "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
                    "shasum": ""
                },
                "require": {
                    "php": "^7.0 || ^8.0",
                    "psr/http-message": "^1.0 || ^2.0"
                },
                "type": "library",
                "extra": {
                    "branch-alias": {
                        "dev-master": "1.0.x-dev"
                    }
                },
                "autoload": {
                    "psr-4": {
                        "Psr\\Http\\Client\\": "src/"
                    }
                },
                "notification-url": "https://packagist.org/downloads/",
                "license": [
                    "MIT"
                ],
                "authors": [
                    {
                        "name": "PHP-FIG",
                        "homepage": "https://www.php-fig.org/"
                    }
                ],
                "description": "Common interface for HTTP clients",
                "homepage": "https://github.com/php-fig/http-client",
                "keywords": [
                    "http",
                    "http-client",
                    "psr",
                    "psr-18"
                ],
                "support": {
                    "source": "https://github.com/php-fig/http-client"
                },
                "time": "2023-09-23T14:17:50+00:00"
            },

    Can you explain more how can downgrade the psr/http-message package to 1.1?

  • 🇯🇵Japan xiaohua guan Tokyo, Japan

    @mukhtarm

    Can you try the command below?

    composer require psr/http-message:1.1

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update about 1 year ago
    Composer require failure
  • @xiaohua-guan opened merge request.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update about 1 year ago
    Composer require failure
  • 🇮🇳India mukhtarm

    Yes now the issue is fixed. Thanks @Xiaohua Guan

  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update about 1 year ago
    Composer require failure
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update about 1 year ago
    Composer require failure
  • Merge request !2285Draft: 6.x → (Closed) created by xiaohua guan
Production build 0.71.5 2024