From 14fc3d156665e20f8e97ba38b91d6a250fa80e85 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 25 Sep 2023 19:38:42 +0200 Subject: [PATCH] Fix GH-12297: PHP Startup: Invalid library (maybe not a PHP library) 'mysqlnd.so' in Unknown on line On some configurations, the COMPILE_DL_MYSQLND must come from config.h. If it isn't set, the get_module function won't be exposed, resulting in a failure when trying to load the library. It's the same issue ext/fileinfo had a while back that was fixed in b0ba368d5. Closes GH-12299. --- NEWS | 4 ++++ ext/mysqlnd/php_mysqlnd.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 22ccf6af0ed..570beeebf3c 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,10 @@ PHP NEWS . Fixed bug GH-12282 (IntlDateFormatter::construct should throw an exception on an invalid locale). (David Carlier) +- MySQLnd: + . Fixed bug GH-12297 (PHP Startup: Invalid library (maybe not a PHP library) + 'mysqlnd.so' in Unknown on line). (nielsdos) + - PCRE: . Fixed bug GH-11956 (Backport upstream fix, PCRE regular expressions with JIT enabled gives different result). (nielsdos) diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c index ff31a54b454..dd7ded12c20 100644 --- a/ext/mysqlnd/php_mysqlnd.c +++ b/ext/mysqlnd/php_mysqlnd.c @@ -15,6 +15,9 @@ +----------------------------------------------------------------------+ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "php.h" #include "mysqlnd.h" #include "mysqlnd_priv.h"