问题
I have been trying to install mongo for over 6 hours now and still have not gotten it to work. I am going to make this very detailed so that hopefully someone will help me get this working.
My local comp: HP laptop, Windows 7, 64 bit operating system
WAMP 2.2 which includes php 5.3.8 and apache 2.2.21 downloaded from wampserver.com
I have tried installing every combination of mangodb with no success.
I started by downloading the 64 bit download from mongos website. It works fine when I use it from the command line shell but once I install the php_mongo.dll
and use it from PHP I get the "mongo not found" error. Also, I checked my php.ini
file and mongo is not loading in. I checked the errors and saw "php_mongo.dll is not a win32 application".
I then tried installing a new php_mongo.dll
that was vc9 since that is what my php.ini
file says. I still get the same problem, it works in when I use it from the command line but not in PHP.
I then deleted all of the mongo files and treid downloaded the 32 bit verson of mongo just to give it a try (my os is 64 bit). Same thing, works in the command line shell but not in PHP. I get the same errors as above.
My php.ini
file looks like this:
System Windows NT xxxxx-PC 6.1 build 7601 (Windows 7 Home Premium Edition
Service Pack 1) AMD64
Build Date Sep 16 2011 21:25:01
Compiler MSVC9 (Visual C++ 2008)
Architecture x64
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-
pdo-oci=C:\php-sdk\php53dev\vc9\x64\deps\instantclient_10_2\sdk,shared" "--with-
oci8=C:\php-sdk\php53dev\vc9\x64\deps\instantclient_10_2\sdk,shared" "--with-
oci8-11g=C:\php-sdk\php53dev\vc9\x64\deps\instantclient_11_2\sdk,shared" "--disable-
debug-pack" "--disable-static-analyze"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\wamp\bin\apache\Apache2.2.21\bin\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20090626
PHP Extension 20090626
Zend Extension 220090626
Zend Extension Build API220090626,TS,VC9
PHP Extension Build API20090626,TS,VC9
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
Zend Multibyte Support disabled
IPv6 Support enabled
Registered PHP Streams php, file, glob, data, http, ftp, zip, compress.zlib, phar
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13,
string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk,
zlib.*
I don't know what I am doing wrong. Again, I have tried every combination of the download and I cannot get a connection from php. Can someone please walk me through the download based on the above information of my system set up or point out what I am doing wrong?
I have tried the basic set up options from mongos site. I have also spent hours of google and from other blogs I know there are some issues with 64 bit comps and there are many other people getting these same errors. I can't seem to find an answer that works or that is detailed enough for a newbie to follow.
Thank you for any help. I just don't know what to do at this point, I've been working on setting up mongo for over 6 hours. Can someone please help?
回答1:
Ok so after hours and hours of searching for an answer to my original question which was:
I am running a 64 bit machine with a 64 bit wamp stack but mongodb will not work in wamp 64 bit, how do i get all this working?
I finally just uninstalled wamp 64 bit and downloaded wamp 32 bit onto my windows 64 bit machine. I then downloaded the mongo 64 bit version and everything is working fine.
回答2:
PHP driver for Mongo DB is not currently working for 64bit wamp (you can keep your OS 64bit). Basically what you need to do:
install 32 bit WAMP
add PHP mongo driver "php_mongo-1.3.2RC1-5.4-vc9.dll", ts(thread safe) to php ext foldr download: https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
rename "extension=php_mongo.dll" to "php_mongo.dll" and add extension=php_mongo.dll to php.ini in your server
回答3:
Solved:
My operating system is 32 bit Windows 7
I did the following to add the mongoDb extension into my php:
1. Used: https://s3.amazonaws.com/drivers.mongodb.org/php/index.html
2. Downloaded: php_mongo-1.5.1.zip and unzip the file which contains the binaries for different PHP versions.
3. Copy php_mongo-1.5.1-5.4-vc9.dll to C:\wamp\bin\php\php5.4.3\ext as php_mongo.dll
4. Added the following line in php.ini
extension=php_mongo.dll
5. Restart my wamp server
Used localhost/?phpinfo=1 to see the installed extension. It works fine.
First I tried php_mongo-1.5.5.zip to do the same but it was not working then successfully configured with php_mongo-1.5.1.zip.
Cheers...
来源:https://stackoverflow.com/questions/8891551/troubleshooting-mongo-not-found-and-php-mongo-dll-is-not-a-win32-application