Skip to content

mysqlnd depends on openssl when build shared #18003

Open
@shyim

Description

@shyim

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions