# Cannot configure php with mongodb inside Local

**URL:** https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768
**Category:** Archived Support
**Tags:** windows-10
**Created:** [May 8, 2024, 2:47pm UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768 "2024-05-08T14:47:04Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![ipp02](https://avatars.discourse-cdn.com/v4/letter/i/49beb7/32.png) [@ipp02](https://community.localwp.com/u/ipp02)
#### Post date: [May 8, 2024, 2:47pm UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/1 "2024-05-08T14:47:04Z")

</div>

### What issue or error are you experiencing?

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

![image](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/1/c/1cc3b4f5794d69e210e2ba394847e508dbd674d9.png)

* * *

### System Details

- **9.0.1**

- **Windows 10**

* * *

---

<div class="post-metadata">

### Author: ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)
#### Post date: [May 9, 2024, 1:13pm UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/2 "2024-05-09T13:13:40Z")

</div>

Hi @ipp02

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:

> [@Win32: WP-CLI: Warning: PHP Startup: Unable to load dynamic library ‘php\_imagick.dll’](https://community.localwp.com/t/win32-wp-cli-warning-php-startup-unable-to-load-dynamic-library-php-imagick-dll/30087):
>
> Bug Summary On windows, opening a site shell results in a bunch of "Unable to load dynamic library ‘php\_imagick.dll’ " warnings to be printed. This happens both with the “command prompt” and “git bash” terminal setting. See also: [PHP 7.4.1 and Windows 10 lead to WP-CLI: Warning: PHP Startup: Unable to load dynamic library 'php\_imagick.dll'](http://community.localwp.com/t/php-7-4-1-and-windows-10-lead-to-wp-cli-warning-php-startup-unable-to-load-dynamic-library-php-imagick-dll/26371)[PHP Startup: Unable to load dynamic library 'php\_imagick.dll'](http://community.localwp.com/t/php-startup-unable-to-load-dynamic-library-php-imagick-dll/17523)[WP-CLI warnings with PHP 7.4.1 on Windows 10](http://community.localwp.com/t/wp-cli-warnings-with-php-7-4-1-on-windows-10/22987)[PHP imagick issue on Windows 10](http://community.localwp.com/t/php-imagick-issue-on-windows-10/28936)Steps to reprod…

---

<div class="post-metadata">

### Author: ![ipp02](https://avatars.discourse-cdn.com/v4/letter/i/49beb7/32.png) [@ipp02](https://community.localwp.com/u/ipp02)
#### Post date: [May 9, 2024, 1:49pm UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/3 "2024-05-09T13:49:06Z")

</div>

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! 🙂

---

<div class="post-metadata">

### Author: ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)
#### Post date: [May 9, 2024, 1:55pm UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/4 "2024-05-09T13:55:39Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ipp02](https://avatars.discourse-cdn.com/v4/letter/i/49beb7/32.png) [@ipp02](https://community.localwp.com/u/ipp02)
#### Post date: [May 9, 2024, 2:17pm UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/5 "2024-05-09T14:17:09Z")

</div>

The same support for MongoDB, that is configured inside the custom plugin that I am developing. If it is needed of course? @Nick-B

---

<div class="post-metadata">

### Author: ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)
#### Post date: [May 9, 2024, 2:25pm UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/6 "2024-05-09T14:25:41Z")

</div>

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.

> [@MongoDB install option](https://community.localwp.com/t/mongodb-install-option/319/2):
>
> That would be really nice.

---

<div class="post-metadata">

### Author: ![ipp02](https://avatars.discourse-cdn.com/v4/letter/i/49beb7/32.png) [@ipp02](https://community.localwp.com/u/ipp02)
#### Post date: [May 9, 2024, 2:45pm UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/7 "2024-05-09T14:45:49Z")

</div>

I am doing everything according to the documentation and this is why I am confused that it may be a problem with Localwp instead? Thank you!

---

<div class="post-metadata">

### Author: ![ipp02](https://avatars.discourse-cdn.com/v4/letter/i/49beb7/32.png) [@ipp02](https://community.localwp.com/u/ipp02)
#### Post date: [May 10, 2024, 5:09am UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/8 "2024-05-10T05:09:49Z")

</div>

I solved it!

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\`.

Hopefully this would be of some help to someone!

---

<div class="post-metadata">

### Author: ![sambrockway](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/sambrockway/32/18726_2.png) [@sambrockway](https://community.localwp.com/u/sambrockway)
#### Post date: [May 10, 2024, 12:36pm UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/9 "2024-05-10T12:36:43Z")

</div>

Hello @ipp02 -

Thank you for sharing what worked for you - we appreciate that!

Happy building,

Sam 💚

---

<div class="post-metadata">

### Author: ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)
#### Post date: [May 12, 2024, 12:37am UTC](https://community.localwp.com/t/cannot-configure-php-with-mongodb-inside-local/42768/10 "2024-05-12T00:37:40Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
