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

Changing PHP version disables extensions on self hosted runners #642

Closed
3 of 5 tasks
Tjitse-E opened this issue Sep 7, 2022 · 4 comments
Closed
3 of 5 tasks

Changing PHP version disables extensions on self hosted runners #642

Tjitse-E opened this issue Sep 7, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Tjitse-E
Copy link

Tjitse-E commented Sep 7, 2022

Describe the bug

  1. Create a single self hosted runner
  2. Run a workflow with PHP 7.4 on that runner
  3. Try to require a composer dependency that requires a PHP extension (examples: GD, SOAP BCMATH)
  4. Run a workflow with PHP 8.1 on that runner
  5. Require the same composer dependency again
  6. Now you will get an error, the PHP extensions that are required are disabled..

Version

  • I have checked releases, and the bug exists in the latest patch version of v1 or v2.
  • v2
  • v1

Runners

  • GitHub Hosted
  • Self Hosted

Operating systems
Ubuntu Focal

PHP versions
I tested with PHP 7.4 and PHP 8.1

To Reproduce
Try once with PHP 7.4 and once with PHP 8.1 using the same runner.

      - name: Setup PHP with PECL extension
        uses: shivammathur/setup-php@v2
        with:
          coverage: none
          php-version: ${{ env.PHP_VERSION }}
          tools: composer:v2
          extensions: gd, bcmath, soap, pdo_mysql, ctype, curl, dom, hash, iconv, intl, mbstring, openssl, simplexml, xsl, sockets, zip
        env:
          runner: self-hosted
          update: true

      - name: Install composer dependencies
        run: |
          composer install --prefer-dist --no-interaction

Expected behavior
The soap, bcmath and gd PHP extensions are enabled on both PHP 7.4 and PHP 8.1

Screenshots/Logs
On the second run you will get the following error:

Error: Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - laminas/laminas-soap is locked to version 2.10.0 and an update of this package was not requested.
    - laminas/laminas-soap 2.10.0 requires ext-soap * -> it is missing from your system. Install or enable PHP's soap extension.
  Problem 2
    - magento/framework is locked to version 103.0.4-p1 and an update of this package was not requested.
    - magento/framework 103.0.4-p1 requires ext-bcmath * -> it is missing from your system. Install or enable PHP's bcmath extension.
  Problem 3
    - magento/module-shipping is locked to version 100.4.4 and an update of this package was not requested.
    - magento/module-shipping 100.4.4 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
  Problem 4
    - magento/product-community-edition is locked to version 2.4.4-p1 and an update of this package was not requested.
    - magento/product-community-edition 2.4.4-p1 requires ext-bcmath * -> it is missing from your system. Install or enable 

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/8.1/cli/php.ini
    - /etc/php/8.1/cli/conf.d/10-***nd.ini
    - /etc/php/8.1/cli/conf.d/10-opcache.ini
    - /etc/php/8.1/cli/conf.d/10-pdo.ini
    - /etc/php/8.1/cli/conf.d/15-xml.ini
    - /etc/php/8.1/cli/conf.d/20-calendar.ini
    - /etc/php/8.1/cli/conf.d/20-ctype.ini
    - /etc/php/8.1/cli/conf.d/20-curl.ini
    - /etc/php/8.1/cli/conf.d/20-dom.ini
    - /etc/php/8.1/cli/conf.d/20-exif.ini
    - /etc/php/8.1/cli/conf.d/20-ffi.ini
    - /etc/php/8.1/cli/conf.d/20-fileinfo.ini
    - /etc/php/8.1/cli/conf.d/20-ftp.ini
    - /etc/php/8.1/cli/conf.d/20-gettext.ini
    - /etc/php/8.1/cli/conf.d/20-iconv.ini
    - /etc/php/8.1/cli/conf.d/20-intl.ini
    - /etc/php/8.1/cli/conf.d/20-mbstring.ini
    - /etc/php/8.1/cli/conf.d/20-***i.ini
    - /etc/php/8.1/cli/conf.d/20-pdo_***.ini
    - /etc/php/8.1/cli/conf.d/20-pdo_pgsql.ini
    - /etc/php/8.1/cli/conf.d/20-pgsql.ini
    - /etc/php/8.1/cli/conf.d/20-phar.ini
    - /etc/php/8.1/cli/conf.d/20-posix.ini
    - /etc/php/8.1/cli/conf.d/20-readline.ini
    - /etc/php/8.1/cli/conf.d/20-shmop.ini
    - /etc/php/8.1/cli/conf.d/20-simplexml.ini
    - /etc/php/8.1/cli/conf.d/20-sockets.ini
    - /etc/php/8.1/cli/conf.d/20-sysvmsg.ini
    - /etc/php/8.1/cli/conf.d/20-sysvsem.ini
    - /etc/php/8.1/cli/conf.d/20-sysvshm.ini
    - /etc/php/8.1/cli/conf.d/20-tokenizer.ini
    - /etc/php/8.1/cli/conf.d/20-xmlreader.ini
    - /etc/php/8.1/cli/conf.d/20-xmlwriter.ini
    - /etc/php/8.1/cli/conf.d/20-xsl.ini
    - /etc/php/8.1/cli/conf.d/20-zip.ini
    - /etc/php/8.1/cli/conf.d/99-pecl.ini
    - 

Additional context

Are you willing to submit a PR?

@Tjitse-E Tjitse-E added the bug Something isn't working label Sep 7, 2022
@shivammathur
Copy link
Owner

@Tjitse-E
Thanks for reporting this. I will have a look this weekend.

@shivammathur
Copy link
Owner

Fixed in 7aff4d7
Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/3030342518/workflow

@shivammathur shivammathur added the awaiting-release Added/Fixed and tested, awaiting release label Sep 11, 2022
@Tjitse-E
Copy link
Author

Tjitse-E commented Sep 13, 2022

Fixed in 7aff4d7 Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/3030342518/workflow

@shivammathur great! I just confirmed that this fixes the issue.

@shivammathur
Copy link
Owner

Released 2.22.0 with the fix.

@shivammathur shivammathur removed the awaiting-release Added/Fixed and tested, awaiting release label Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants