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 installation fails with PHP 8.1 #124

Open
ninoslavjaric opened this issue Feb 10, 2025 · 0 comments
Open

Composer installation fails with PHP 8.1 #124

ninoslavjaric opened this issue Feb 10, 2025 · 0 comments

Comments

@ninoslavjaric
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant