Skip to content

Bug: PHP 8.4 BrokenΒ #947

Closed
Closed

Description

@GrahamCampbell

Describe the bug

Run shivammathur/setup-php@v2
/usr/bin/bash /home/runner/actions-runner/_work/_actions/shivammathur/setup-php/v2/src/scripts/run.sh

==> Setup PHP
βœ“ PHP Installed PHP 8.4.6

==> Setup Extensions
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/lib/php/20240924/mbstring.so (/usr/lib/php/20240924/mbstring.so: undefined symbol: zend_get_property_info_for_slot_slow), /usr/lib/php/20240924/mbstring.so.so (/usr/lib/php/20240924/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
βœ“ grpc Installed and enabled
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/lib/php/20240924/mbstring.so (/usr/lib/php/20240924/mbstring.so: undefined symbol: zend_get_property_info_for_slot_slow), /usr/lib/php/20240924/mbstring.so.so (/usr/lib/php/20240924/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/lib/php/20240924/mbstring.so (/usr/lib/php/20240924/mbstring.so: undefined symbol: zend_get_property_info_for_slot_slow), /usr/lib/php/20240924/mbstring.so.so (/usr/lib/php/20240924/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/lib/php/20240924/mbstring.so (/usr/lib/php/20240924/mbstring.so: undefined symbol: zend_get_property_info_for_slot_slow), /usr/lib/php/20240924/mbstring.so.so (/usr/lib/php/20240924/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
βœ“ protobuf Installed and enabled
βœ“ sodium Enabled
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/lib/php/20240924/mbstring.so (/usr/lib/php/20240924/mbstring.so: undefined symbol: zend_get_property_info_for_slot_slow), /usr/lib/php/20240924/mbstring.so.so (/usr/lib/php/20240924/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
βœ“ :psr Could not find psr on PHP 8.4.6

==> Setup Tools
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/lib/php/20240924/mbstring.so (/usr/lib/php/20240924/mbstring.so: undefined symbol: zend_get_property_info_for_slot_slow), /usr/lib/php/20240924/mbstring.so.so (/usr/lib/php/20240924/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
βœ“ composer Added composer 2.8.6

==> Setup Coverage
βœ“ none Disabled Xdebug and PCOV

Then when running composer, we see the wrong version of PHP used:

 PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/lib/php/20240924/mbstring.so (/usr/lib/php/20240924/mbstring.so: undefined symbol: zend_get_property_info_for_slot_slow), /usr/lib/php/20240924/mbstring.so.so (/usr/lib/php/20240924/mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
  Installing dependencies from lock file (including require-dev)
  Verifying lock file contents can be installed on current platform.
  Your lock file does not contain a compatible set of packages. Please run composer update.
  
    Problem 1
      - Root composer.json requires php ~8.4.5 but your php version (8.4.4) does not satisfy that requirement.

Expecting 8.4.6, but 8.4.4 was used.

Version

  • v2
  • v1

Runners

Self Hosted

Operating systems

Ubuntu 22.04

PHP versions

8.4

To Reproduce

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.4'
          extensions: grpc, protobuf, sodium, :php-psr
          tools: composer:v2
          coverage: none
        env:
          update: true

Expected behavior

For the mbstring extension to be loaded, and PHP 8.4.6 linked.

Screenshots/Logs

No response

Additional context

No response

Are you willing to submit a PR?

Yes

Activity

  1. shivammathur commented on May 7, 2025

    @shivammathur
    Owner

    @GrahamCampbell

    Please try with specifying the runner env as self-hosted in the setup-php step.
    https://github.com/shivammathur/setup-php?tab=readme-ov-file#self-hosted-setup

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.4'
        extensions: grpc, protobuf, sodium, :php-psr
        tools: composer:v2
        coverage: none
      env:
        update: true
        runner: self-hosted
  2. shivammathur commented on May 14, 2025

    @shivammathur
    Owner

    @GrahamCampbell was that helpful?

  3. GrahamCampbell commented on May 14, 2025

    @GrahamCampbell
    ContributorAuthor

    Thanks for the reply. It's too early to say, as this was a flaky issue. We're letting this bed in for a week or so, to see if it re-occurs with this change applied.

  4. GrahamCampbell commented on May 16, 2025

    @GrahamCampbell
    ContributorAuthor

    It looks like this issue is still reoccurring from time to time.

  5. shivammathur commented on May 16, 2025

    @shivammathur
    Owner

    @GrahamCampbell
    Please try recreating this with shivammathur/setup-php@more-verbose instead of v2 and provide me the logs.

  6. GrahamCampbell commented on May 28, 2025

    @GrahamCampbell
    ContributorAuthor

    We were able to reproduce a similar bug, on another self-hosted runner with a different image: https://gist.github.com/GrahamCampbell/b469e915e48db44fa1e7133e0eadae29.

  7. GrahamCampbell commented on May 28, 2025

    @GrahamCampbell
    ContributorAuthor

    For comparison, here's a slow, but working run: https://gist.github.com/GrahamCampbell/2993f114430f2a8be496c9058ff04bdc.

  8. shivammathur commented on May 29, 2025

    @shivammathur
    Owner

    @GrahamCampbell
    I'm not sure why sqlsrv extensions would be added in this workflow. The only reason this can occur is if it was run without the env runner: self-hosted on that machine.

    If you need the sqlsrv extensions, I would suggest running the following and adding the extensions to the workflow.

    sudo apt-get install unixodbc -y
    

    If not, I would suggest disabling them by removing the php.ini entry for them, you can do that manually or by running a workflow with the step below once, and then you can revert it.

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.4'
        extensions: :sqlsrv, :pdo_sqlsrv, grpc, protobuf, sodium, :php-psr
        tools: composer:v2
        coverage: none
      env:
        update: true
        runner: self-hosted
  9. shivammathur commented on Jun 10, 2025

    @shivammathur
    Owner

    There should be better support for checking self-hosted runners in 2.34.0 that should prevent such cases. If this happens again, please reopen the issue.

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions