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)