简体   繁体   中英

WAMP MongoDB - PHP extension

I have a problem with installation of MongoDB extension to PHP in WAMP SERVER.

The error that I obtain is show in photo在此处输入图片说明

For the latest versions, we have to be careful about thread-safe version of the dll file too.

You can download latest dll from this link. https://pecl.php.net/package/mongodb

在此处输入图片说明

And in this link, you have thread-safe and and non-thread-safe versions of .dll file.

在此处输入图片说明

if you have php7ts.dll or ts.dll file in your PHP installed directory you need to download that thread-safe dll file.

在此处输入图片说明

And after download you can add dll file to \\wamp\\bin\\php\\php{version}\\ext directory and call inside php.ini file

extension=php_mongodb.dll

One other piece of information on this:

  • After you do "add extension=mongodb in bin->apache->apache(version)->bin->php.ini", you have to exit wampserver (right click the systray icon an choose exit) and restart it for it to "see" your change in the apache php file. Simply stopping and starting all services from the left click menu of wampserver does not refresh this new setting.

That is telling you that you have not added the following line to the correct php.ini file

Use

wampmanager -> PHP -> php.ini

to edit the CORRECT php.ini file.

Add your

extension=php_mongo.dll 

with the other extension lines

If you have an extension line set in the correct php.ini file, then you need to ensure that the DLL with the same name is in the \\wamp\\bin\\php\\php{version}\\ext folder

在 bin->apache->apache(version)->bin->php.ini 添加 extension=mongodb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM