mongodb / mongo-php-driver

The Official MongoDB PHP driver
https://pecl.php.net/package/mongodb
Apache License 2.0
891 stars 205 forks source link

mongodb incompatible API module with PHP 8.4.1 on Windows #1756

Open kemal-xx opened 1 day ago

kemal-xx commented 1 day ago

Bug Report

$ /c/Dev/php84/php.exe -v
PHP Warning:  PHP Startup: mongodb: Unable to initialize module
Module compiled with module API=20230901
PHP    compiled with module API=20240924
These options need to match
 in Unknown on line 0

Warning: PHP Startup: mongodb: Unable to initialize module
Module compiled with module API=20230901
PHP    compiled with module API=20240924
These options need to match
 in Unknown on line 0
PHP 8.4.1 (cli) (built: Nov 20 2024 11:13:29) (ZTS Visual C++ 2022 x64)
Copyright (c) The PHP Group
Zend Engine v4.4.1, Copyright (c) Zend Technologies
    with Xdebug v3.4.0beta1, Copyright (c) 2002-2024, by Derick Rethans

Environment

Using Windows 10.0.19045 Build 19045 Using PHP 8.4.1 download from https://windows.php.net/downloads/releases/php-8.4.1-Win32-vs17-x64.zip Using MongoDB library from php_mongodb-1.20.0-8.4-ts-vs17-x64.zip downloaded from https://github.com/mongodb/mongo-php-driver/releases

jmikola commented 1 day ago

The 1.20.0 release was published on 2024-09-24, some time before the final release of PHP 8.4. Our GitHub release process that creates those DLLs must have run against a pre-release version (beta or RC).

We'll look into this and see how feasible it is to regenerate those release assets. Worst case I suppose we can cut a 1.20.1 release.

I'll also note that PECL does not have any PHP 8.4 DLL builds for earlier releases (https://pecl.php.net/package/mongodb/1.20.0/windows). Those are sometimes generated retroactively, so I'll inquire internally if there are plans to do so.

jmikola commented 2 hours ago

We're planning to publish a 1.20.1 release tomorrow, which will generate new DLLs. Will follow up here once that's done.

Additionally, I checked with the PECL team and there are plans to rebuild PHP 8.4 DLLs for various extension releases that were done prior to the PHP 8.4.0 release. See https://news-web.php.net/php.internals.win/1313 for more info on that.