DEV Community

muneebejazz
muneebejazz

Posted on

Complete Guide to install mongdb driver for XAMPP PHP

Step 1:
Make sure that have downloaded an install the mongodb community edition if not download it from

https://www.mongodb.com/try/download/community2

Step 2:

Download the Mongodb PHP extension file from
https://pecl.php.net/package/mongodb

For Windows Users click the DLL button to download the Windows version of the extension
Make sure to download the file according to your PHP version.

Image description

Step 3:
Copy the downloaded php_mongodb.dll file to
C:\xampp\php\ext

Step 4:
Add the extension in php.ini File

method 1: open the php.ini file selected from xampp config and select php.ini

Image description

Find extension=php_

and add line
extension=php_mongodb.dll

Image description

method 2: open the php.ini file from C:\xampp\php\php.ini and follow the process from method 1.

Step 5:

create a testfile.php in folder C:\xampp\htdocs\

and add the code

<?php phpinfo(); ?>

and check if the mongodb extension is installed.

Image description

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay