I am trying to setup MongoDB on one of my test websites, that I created with Local. I follow the guideline, that is presented in the MongoDB documentation, but then whenever I open the site shell of that website, it first warns me: Warning: PHP Startup: Unable to load dynamic library ‘php_mongodb.dll’ (tried: C:/Users/qhuser/AppData/Roaming/Local/lightning-services/php-8.1.23+0/bin/win64/ext\php_mongodb.dll (The specified procedure could not be found), C:/Users/qhuser/AppData/Roaming/Local/lightning-services/php-8.1.23+0/bin/win64/ext\php_php_mongodb.dll.dll (The specified module could not be found)) in Unknown on line 0.
Then I cannot see the support for mongo added, when running php -m command.
Is this problem with Local, and can someone help me how to configure the php.ini & the ext folder properly, in order to make it work, should I restart (because I did several times) or do something else.
I am into dead end for now.
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
I’m not familiar with working with MongoDB, but the error message looks similar to this one I’ve seen crop up for ImageMagick. Sharing this as it might be helpful in troubleshooting:
Hey, @Nick-B, do you know if I should also configure the php.ini of the Localwp website, with support for mongodb, in order to make the plugin work. Thank you!
What is it that you need to configure in php.ini? Generally speaking, changes in there can be saved and then you Stop and Start the site so it can set those.
Again I’m not familiar with MongoDB so I’m unsure with what is required here. Do they have any documentation or support regarding how best to implement it locally?
I see we have an older feature request here for MongoDB support I’ll share here for you or others to upvote, comment and follow.
Will share the solution, in order to hopefully save someone some time:
When you are creating Localwp website for local development, in order to enhance the functionality of the wordpress website (i.e., in my case, add custom plugin with npx create-divi-extension command), make sure, that whatever additional libraries and extensions you add to the custom plugin ( like MongoDB in my case ), you also add support for the extension to the actual Localwp website.
For example for windows users, if you add extension=php_mongodb.dll in the php.ini file of the plugin and add the php_mongodb.dll file (with appropriate version and type safety) to the /ext folder, which the plugin uses, also add that extension to the appropriate php.ini & /ext of the localwp website. They are located inside such folders: C:\Users\...\AppData\Roaming\Local\lightning-services\ & C:\Users\...\AppData\Roaming\Local\run\.