I want to connect to MongoDB from PHP but I keep getting the fatal error in the title. My PHP version is 5.5.14, architecture x86, thread safety enabled, VC11.
So I downloaded 5.5 Thread Safe (TS) x86 from PECL , extracted php_mongo.dll to the \\ext\\
folder of my php installation, added extension=php_mongo.dll
to the php.ini file, and restarted Apache.
I keep getting the same fatal error when I use either Mongo()
and MongoClient()
.
Also, I can access mongo from CMD, starting it with mongod
and then opening another cmd window to handle the database using mongo
. I installed PHP and Apache separately (No XAMPP or WAMP) on Windows 8.1 x64.
Installation folders:
C:\\Apache24
C:\\php
C:\\Program Files\\MongoDB
在最新版本中,您可以使用新的MongoDB \\ Driver \\ Manager()创建obj而不是MongoClient()。
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.