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

PHP-Ext pdo_mysql does not load correctly #797

Open
cngJo opened this issue Feb 19, 2025 · 8 comments
Open

PHP-Ext pdo_mysql does not load correctly #797

cngJo opened this issue Feb 19, 2025 · 8 comments

Comments

@cngJo
Copy link

cngJo commented Feb 19, 2025

Hey!

not sure if its an issue on my side, but as soon as I try to install the pdo_mysql extension, all PHP starts with a warning:

Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /usr/lib/php/modules/pdo_mysql.so (/usr/lib/php/modules/pdo_mysql.so: undefined symbol: mysqlnd_get_client_info), /usr/lib/php/modules/pdo_mysql.so.so (/usr/lib/php/modules/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

It works flawlessly with pdo_sqlite, but pdo_mysql seems to be broken for some reason. I'm using the ´caddy´ variant with PHP 8.4. (Also tries 8.2 with the same result).

This is a minimal Dockerfile that throws that error for me.

FROM ghcr.io/shyim/wolfi-php/caddy:8.4

RUN apk add --no-cache php-8.4-pdo_mysql

WORKDIR /var/www/html

COPY --chown=82 . .

Files:

public/
  index.php
Dockerfile
.dockerignore

(Let me know when you want a reproduction git repo when that's not enough information)

During the build everything is fine, but when starting the container (both locally and at render.com), I get the error form above:

Image

Is that something on my side or is this a general error with pdo_mysql here?

Thank you!

@shyim
Copy link
Owner

shyim commented Feb 19, 2025

Can you install php-8.4-pdo php-8.4-mysqlnd too?

@cngJo
Copy link
Author

cngJo commented Feb 19, 2025

Strange, updated the Dockerfile to:

FROM ghcr.io/shyim/wolfi-php/caddy:8.2

RUN apk add --no-cache \
    php-8.2-pdo \
    php-8.2-mysqlnd \
    php-8.2-pdo_mysql

WORKDIR /var/www/html

COPY --chown=82 . .

That now works for PHP 8.4,

Image

but throws the same error for pdo_mysql and mysqlnd on PHP 8.2 🤔

Image

I might get away with just using PHP 8.4 for this project, but would be good to have it working for PHP 8.2 nevertheless. Is this something I can help fixing?

@shyim
Copy link
Owner

shyim commented Feb 19, 2025

I need to fix the dependencies of the packages, that It knows it automatically.. Let me check for 8.2

@shyim
Copy link
Owner

shyim commented Feb 19, 2025

I remembered, installing curl extension fixes it wolfi-dev/os#10921

@cngJo
Copy link
Author

cngJo commented Feb 19, 2025

da fuck, that works 🎉, added curl and now it works. Thank you!

Should I left this issue open to fix the underlying issue, so that I can use pdo_mysql without installing curl? :D

@shyim
Copy link
Owner

shyim commented Feb 19, 2025

keep it open to look why this happens

@realsamanrad
Copy link

This problem also exists for mysqli extension in php-8.2 and 8.3 (also frankenphp-8.2 and 8.3).
Installing the curl module didn't help.

@shyim
Copy link
Owner

shyim commented Mar 8, 2025

I found the root issue: php/php-src#18003

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants