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

Bug: unable to load mbstring library for php-8.4 #882

Closed
1 of 2 tasks
userator opened this issue Nov 8, 2024 · 5 comments
Closed
1 of 2 tasks

Bug: unable to load mbstring library for php-8.4 #882

userator opened this issue Nov 8, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@userator
Copy link

userator commented Nov 8, 2024

Describe the bug

unable to load mbstring library

Version

  • v2
  • v1

Runners

GitHub Hosted

Operating systems

ubuntu-22.04

PHP versions

8.4

To Reproduce

configuring

jobs:
  phpunit:
    name: PHP ${{ matrix.php }}

    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        include:
          - php: 8.4
            extensions: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached
            coverage: none
            os: ubuntu-latest

executing

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

==> Setup PHP
✓ PHP Installed PHP 8.4.0-dev (a0c7550886e6a185489d341d733eb04923d5fccf)

==> Setup Extensions
✓ apcu Enabled
✓ curl Enabled
✓ dom Enabled
✓ imagick Enabled
✓ intl Enabled
✓ mbstring 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: php_pcre2_code_free), /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 'pgsql.so' (tried: /usr/lib/php/20240924/pgsql.so (/usr/lib/php/20240924/pgsql.so: undefined symbol: php_pcre2_match), /usr/lib/php/20240924/pgsql.so.so (/usr/lib/php/20240924/pgsql.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 'zip.so' (tried: /usr/lib/php/20240924/zip.so (/usr/lib/php/20240924/zip.so: undefined symbol: php_pcre2_match), /usr/lib/php/20240924/zip.so.so (/usr/lib/php/20240924/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
✓ mcrypt Installed and enabled
✓ memcached Enabled

==> 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: php_pcre2_code_free), /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 'pgsql.so' (tried: /usr/lib/php/20240924/pgsql.so (/usr/lib/php/20240924/pgsql.so: undefined symbol: php_pcre2_match), /usr/lib/php/20240924/pgsql.so.so (/usr/lib/php/20240924/pgsql.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 'zip.so' (tried: /usr/lib/php/20240924/zip.so (/usr/lib/php/20240924/zip.so: undefined symbol: php_pcre2_match), /usr/lib/php/20240924/zip.so.so (/usr/lib/php/20240924/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
✓ composer Added composer 2.8.2
✓ PECL Added PECL 1.10.[15](https://github.com/yiisoft/yii2/actions/runs/11741614489/job/32710622256?pr=20276#step:5:16)

==> Setup Coverage
✓ none Disabled Xdebug and PCOV

==> Add php.ini values
✓ apc.enabled=1 Added to php.ini
✓ apc.shm_size=32M Added to php.ini
✓ apc.enable_cli=1 Added to php.ini
✓ date.timezone=UTC Added to php.ini
✓ session.save_path=/home/runner/work/_temp Added to php.ini

==> Sponsor setup-php
✓ setup-php https://setup-php.com/sponsor

Expected behavior

sucess load mbstring library

Screenshots/Logs

No response

Additional context

https://github.com/yiisoft/yii2/actions/runs/11741614489/job/32710622256?pr=20276

Are you willing to submit a PR?

Yes

@userator userator added the bug Something isn't working label Nov 8, 2024
@userator userator changed the title Bug: unable to load mbstring library Bug: unable to load mbstring library for php-8.4 Nov 8, 2024
@shivammathur
Copy link
Owner

Thanks for reporting it, I will have a look at it this weekend.

Please make these changes to the workflow as a workaround for now and that should fix it.

  • Change mcrypt to mcrypt-1.0.7 for PHP 8.4.
  • Specify MCRYPT_LIBS: libmcrypt-dev as env to the setup-php step.

Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/11745039967/workflow

@blizzz
Copy link

blizzz commented Nov 11, 2024

Is it a temporary glitch?

I saw it failing also in https://github.com/SAML-Toolkits/php-saml/actions/runs/11746411244/job/32747989690?pr=600

but I see it working in https://github.com/nextcloud/server/actions/runs/11746255419/job/32725600041?pr=49164

@jrfnl
Copy link
Contributor

jrfnl commented Nov 22, 2024

Interesting, I've just started seeing this in one repo too:

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: php_pcre2_code_free), /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 'pgsql.so' (tried: /usr/lib/php/20240924/pgsql.so (/usr/lib/php/20240924/pgsql.so: undefined symbol: php_pcre2_match), /usr/lib/php/20240924/pgsql.so.so (/usr/lib/php/20240924/pgsql.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 'zip.so' (tried: /usr/lib/php/[20](https://github.com/phar-io/phive/actions/runs/11963936888/job/33355353140#step:5:21)240924/zip.so (/usr/lib/php/20240924/zip.so: undefined symbol: php_pcre2_match), /usr/lib/php/20240924/zip.so.so (/usr/lib/php/20240924/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

However, as PHPUnit requires MBString, I know that if no extensions are explicitly passed, it works just fine (as otherwise I would have seen failing builds on PHP 8.4 on dozens of other repos too).

So, it feels like this is only an issue if with: extensions: mbstring is explicitly passed.

Failing build: https://github.com/phar-io/phive/actions/runs/11963936888/job/33355353140#step:7:97
Workflow file: https://github.com/phar-io/phive/blob/9dee3083e1c3c725da498a0a0c34bb8db40762f3/.github/workflows/integrate.yaml#L129-L143

@shivammathur
Copy link
Owner

Fixed in shivammathur/php-builder@9aedf0d.

@jrfnl
Copy link
Contributor

jrfnl commented Nov 22, 2024

@shivammathur Awesome!

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

4 participants