You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS: Windows servercore 2022
PHP: 8.4.2 (using source code), NTS, x64
MongoDB extension: 1.20.1 (Downloaded from pecl repository)
Test Script
I am using Docker to compile and build the php along with some extensions. I have followed the steps mentioned in this page. As per the mongodb installation script, I have used the following commands:
WORKDIR /php-sdk/phpdev/vs${VS_VERSION}/${ARCH}/php-${PHP_VERSION}-src/ext
ADD https://pecl.php.net/get/mongodb-1.20.1.tgz ./mongodb.tgz
RUN tar xzf ./mongodb.tgz && del .\mongodb.tgz && move ./package.xml ./mongodb-1.20.1/ && ren mongodb-1.20.1 mongodb
# download dependencies using phpsdk_deps and run buildconf
RUN configure --with-openssl --enable-mongodb=shared
I have added other configure options as well, if I don't make the mongodb shared, the configure is failing with the message "Static mongodb can not depend on shared openssl".
Error
With the shared option enabled in the configure command, I resolved the above mentioned error but when running nmake command I am getting the following error:
The second build errors seem to be caused by MONGOC_CYRUS_PLUGIN_PATH_PREFIX being undefined. I determined that the constant was introduced in libmongoc 1.26.2 (mongodb/mongo-c-driver@0e771ca) but never added to config.w32 when the PHP driver bumped its libmongoc dependency in the 1.18.1 release (6a2e15a).
In the meantime, you can see if configuring the build with --with-mongodb-sasl=no would unblock you by skipping compilation of mongoc-cyrus.c. Alternatively, consider using a pre-compiled DLL as advised in the install docs for Windows.
Thank you very much @jmikola , the issue got resolved once I added the --without-mongodb-sasl flag. Now, I can see mongodb in the list of extensions available.
I'll keep track of the issue opened and remove the flag (and update the version) once its resolved.
Since I am doing the compilation of extensions along with php-src code, I keep getting the following error if I directly add the DLL files after the compilation is done:
Warning: PHP Startup: Unable to load dynamic library 'mongodb' (tried: C:\php\Debug\mongodb (The specified module could not be found), C:\php\Debug\php_mongodb.dll (The specified module could not be found)) in Unknown on line 0
I did check my environment thrice and I am sure that I have downloaded the right version of DLL files. Is there any way I could resolve this issue? because if I can use DLLs directly it would save a ton of time as I am facing this issue for other extensions also.
Bug Report
Environment
OS: Windows servercore 2022
PHP: 8.4.2 (using source code), NTS, x64
MongoDB extension: 1.20.1 (Downloaded from pecl repository)
Test Script
I am using Docker to compile and build the php along with some extensions. I have followed the steps mentioned in this page. As per the mongodb installation script, I have used the following commands:
I have added other configure options as well, if I don't make the mongodb shared, the configure is failing with the message "Static mongodb can not depend on shared openssl".
Error
With the shared option enabled in the configure command, I resolved the above mentioned error but when running nmake command I am getting the following error:
The last command nmake ran before the above error is:
"cl.exe" /D ZEND_COMPILE_DL_EXT=1 /D COMPILE_DL_MONGODB /D MONGODB_EXPORTS=1 /D BSON_COMPILATION /D MONGOC_COMPILATION /D UTF8PROC_STATIC /Iext\mongodb /Iext\mongodb/src /Iext\mongodb/src/BSON /Iext\mongodb/src/MongoDB /Iext\mongodb/src/MongoDB/Exception /Iext\mongodb/src/MongoDB/Monitoring /Iext\mongodb/src/contrib /Iext\mongodb/src/libmongoc/src/common /Iext\mongodb/src/libmongoc/src/uthash /Iext\mongodb/src/libmongoc/src/libbson/src /Iext\mongodb/src/libmongoc/src/libbson/src/jsonsl /Iext\mongodb/src/libmongoc/src/libmongoc/src /Iext\mongodb/src/libmongoc/src/libmongoc/src/mongoc /Iext\mongodb/src/libmongoc/src/utf8proc-2.8.0 /I "..\deps\include" /DHAVE_OPENSSL_SSL_H=1 /D KMS_MSG_STATIC=1 /D KMS_MESSAGE_ENABLE_CRYPTO=1 /D KMS_MESSAGE_ENABLE_CRYPTO_LIBCRYPTO=1 /DHAVE_SASL_SASL_H=1 /D KMS_MESSAGE_LITTLE_ENDIAN=1 /D MONGOCRYPT_LITTLE_ENDIAN=1 /D MLIB_USER=1 /Iext\mongodb/src/libmongocrypt/src /Iext\mongodb/src/libmongocrypt/kms-message/src /Iext\mongodb/src/libmongocrypt-compat /DHAVE_WINDNS_H=1 /nologo /I . /I main /I Zend /I TSRM /I ext /D _WINDOWS /D WINDOWS=1 /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /D _USE_MATH_DEFINES /FD /wd4996 /RTC1 /Zc:__cplusplus /d2FuncCache1 /Zc:preprocessor /Zc:wchar_t /LDd /MDd /Od /D _DEBUG /D ZEND_DEBUG=1 /Zi /I "..\deps\include" /D FD_SETSIZE=256 /FpC:\php\Debug\/src/libmongoc/src/libmongoc/src/mongoc\ /FRC:\php\Debug\/src/libmongoc/src/libmongoc/src/mongoc\ /FdC:\php\Debug\/src/libmongoc/src/libmongoc/src/mongoc\ /c ext\mongodb\src\libmongoc\src\libmongoc\src\mongoc\mongoc-cyrus.c /FoC:\php\Debug\/src/libmongoc/src/libmongoc/src/mongoc\mongoc-cyrus.obj
Can someone please help me with this issue?
The text was updated successfully, but these errors were encountered: