I had Downloaded and installed the mongo dB And it still showing the error
Please tell me how to configure and connect to MongoDB in PHP
I had Downloaded and installed the mongo dB And it still showing the error
Please tell me how to configure and connect to MongoDB in PHP
3
Answers
Reference
before you connect you want to add a mongo driver for PHP, then you
[reference][1]
[video reference][2]
[1]: https://www.tutorialspoint.com/mongodb/mongodb_php.htm#:~:text=%3C%3F-,php%20%2F%2F%20connect%20to%20mongodb%20%24m%20%3D%20new%20MongoClient()%3B%20echo,('%24set'%3D%3E
[2]: https://www.youtube.com/watch?v=wSIQ8n6H9os
After you completed the installation did you added
in your
php.ini
file? If no please add this line of code to yourphp.ini
file.Please note that each OS has different steps to install the driver.
You can find more info about the PHP driver here
https://www.php.net/manual/en/mongodb.setup.php
To check if you have installed the driver properly, create a
info.php
in your project folder and add this functionphpinfo();
to your file.Visit the
info.php
file in your browser and try to find the mongodb module there, you can use this anchor#module_mongodb
appended to your url to see the module section directly.If you can’t find nothing there, it means that your MongoDB/PHP driver is not installed/configured properly.