简体   繁体   中英

Unable to install MongoDB PHP driver on XAMPP Windows

I am using Windows OS (64-bit) and running XAMPP(PHP 5.4.7). I tried installing the PHP MongoDB Driver but it is not reflecting on the phpinfo() page.

I followed the same steps as listed:

  1. I downloaded php_mongo-1.3.2RC1.zip (latest one) from https://github.com/mongodb/mongo-php-driver/downloads
  2. I extracted the folder and copied the php_mongo-1.3.1-5.4-vc9.dll file and pasted in C://XAMPP/php/ext/ . My PHP extension build says API20100525,TS,VC9
  3. I opened php.ini file and i inserted ;extension=php_mongo-1.3.1-5.4-vc9.dll at the last line.

I then looked at the phpinfo() page as well as I tried the

echo extension_loaded("mongo") ? "loaded\n" : "not loaded\n"; 

It says it is not loaded.

Try removing the ; from the beginning of ;extension=php_mongo-1.3.1-5.4-vc9.dll in your php.ini

After doing all the steps as mentioned in the question, xampp may not be able to load the ".dll" file. Just ensure to add the path of the ".dll" file's folder to the environment variable as a system variable path.

I was facing same issue, then after adding the path of the ".dll" file's folder to the environment variable as a system variable path, it worked. It is then able to find the file.

At the end that was the only step which was stopping xampp to load the ".dll" file, although it was present in that folder. Often people miss this step as it is no where pointed out clearly.

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