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

mysqlnd depends on openssl when build shared #18003

Open
shyim opened this issue Mar 8, 2025 · 1 comment
Open

mysqlnd depends on openssl when build shared #18003

shyim opened this issue Mar 8, 2025 · 1 comment

Comments

@shyim
Copy link

shyim commented Mar 8, 2025

Description

I am building every PHP extension shared like

./configure
   --enable-mysqlnd=shared \
  --with-openssl=shared \
...

When I now load only PHP + mysqlnd, I get the following errors

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

This seems to happen because of https://github.com/php/php-src/blob/master/ext/mysqlnd/config9.m4#L12-L20

I think here are two ways how this can be fixed:

Don't enable that option when openssl is shared or link mysqlnd to libcrypto.so because LD_PRELOAD=/usr/lib/libcrypto.so.3 php -v fixes it to fix up the implict library

PHP Version

PHP 8.3.17

Operating System

No response

@NattyNarwhal
Copy link
Member

I suspect curl and ftp are also affected since they seem have their build scripts check and include OpenSSL in a similar way (PHP_SETUP_OPENSSL into the *_SHARED_LIBADD). phar seems to explicitly demand that the openssl extension is built shared to use OpenSSL there, but I don't see any referencing of OpenSSL in the build otherwise, so phar may also be affected here.

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

No branches or pull requests

3 participants