嗨我(想)只是將MongoDB安裝到我的本地xampp機器上。用XAMPP和php 5.3在Mac osx上安裝Mongo數據庫ext
我在網上跟着教程和一切似乎要做:
感動預編譯
mongo.so
到XAMPP/xampfiles/lib/php/php5.3/extensions/no-debug-non-zts-20090626/
加入這行代碼到php.ini中:
extension = mongo.so
重啓動Apache的
連到本地主機,我可以在
phpinfo()
赴http://localhost:27017看到蒙戈界面上看到蒙戈擴展,無法連接到它(火狐返回一個錯誤)
然後,我下載了mac osx的MongoHub客戶端來創建/管理mongo數據庫,但是它說的是套接字錯誤,似乎沒有連接到MongoDB
我(覺得)我也裝的MongoDB本身
- 我創建的目錄:
XAMPP/xampfiles/var/mongodb
- 我excracted焦油MongoDB的包文件
var/mongodb
下,所以我現在var/mongodb/bin
- 從
var/mongodb
我發起這個命令:
./bin/mongod
而且它返回:
Sun Sep 11 22:40:32 [initandlisten] MongoDB starting : pid=946 port=27017 dbpath=/data/db/ 64-bit
Sun Sep 11 22:40:32 [initandlisten] db version v1.8.3, pdfile version 4.5
Sun Sep 11 22:40:32 [initandlisten] git version: c206d77e94bc3b65c76681df5a6b605f68a2de05
Sun Sep 11 22:40:32 [initandlisten] build sys info: Darwin erh2.10gen.cc 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_40
Sun Sep 11 22:40:32 [initandlisten] exception in initAndListen std::exception: dbpath (/data/db/) does not exist, terminating
Sun Sep 11 22:40:32 dbexit:
Sun Sep 11 22:40:32 [initandlisten] shutdown: going to close listening sockets...
Sun Sep 11 22:40:32 [initandlisten] shutdown: going to flush diaglog...
Sun Sep 11 22:40:32 [initandlisten] shutdown: going to close sockets...
Sun Sep 11 22:40:32 [initandlisten] shutdown: waiting for fs preallocator...
Sun Sep 11 22:40:32 [initandlisten] shutdown: closing all files...
Sun Sep 11 22:40:32 closeAllFiles() finished
Sun Sep 11 22:40:32 dbexit: really exiting now
啓動./bin/mongo
也返回:
MongoDB shell version: 1.8.3
connecting to: test
Sun Sep 11 22:41:11 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:79
exception: connect failed
好極了,所以你安裝了Mongo PHP擴展和一個GUI客戶端。你自己安裝了MongoDB嗎? - HTTP://www.mongodb。org/downloads – salathe
ops:P我認爲不是:P秒也許以後我會回覆%) – sbaaaang
事實是,我找不到一個很好的教程來安裝mongodb包在XAMPP目錄中(如果可能的話):P,你知道嗎怎麼辦? – sbaaaang