Skip to content

Composer installation fails with PHP 8.1 #124

@ninoslavjaric

Description

@ninoslavjaric

Description

I encountered an issue while using php-actions/composer@v6 in my GitHub Actions workflow. The project requires maatwebsite/excel with the version ^3.1 in the composer.json file. The workflow is set up as follows:

- name: Composer install
  uses: php-actions/composer@v6
  with:
    php_version: '8.1'
    args: '--no-dev --prefer-dist --optimize-autoloader'
    dev: no
    progress: yes
    php_extensions: imagick gd gmp

However, the installation fails with the following error message:

Problem 1
    - Root composer.json requires maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, ..., 3.1.x-dev].
    - maatwebsite/excel[3.1.0, ..., 3.1.25] require php ^7.0 -> your php version (8.1.31) does not satisfy that requirement.

Expected behavior:

The package maatwebsite/excel should be compatible with PHP 8.1 since its requirements are "php": "^7.0||^8.0", but it seems like it's not properly recognizing PHP 8.1 as a compatible version.

  1. Use the following setup in your GitHub Actions workflow:
- name: Composer install
  uses: php-actions/composer@v6
  with:
    php_version: '8.1'
    args: '--no-dev --prefer-dist --optimize-autoloader'
    dev: no
    progress: yes
    php_extensions: imagick gd gmp
  1. Have maatwebsite/excel in your composer.json with the version ^3.1.
  2. Run the GitHub Actions workflow.

Actual behavior:

The workflow fails with the error that the PHP version does not meet the maatwebsite/excel requirement, even though PHP 8.1 should be compatible with ^7.0||^8.0.

Additional context:

  • I verified that maatwebsite/excel supports PHP 8.0 and above (according to its composer.json), and my project should be compatible with PHP 8.1.
  • I am using PHP 8.1.31 for this workflow.

Environment:

  • PHP version: 8.1.31
  • GitHub Action: php-actions/composer@v6
  • OS: Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions