2015-04-22 131 views
1

MongoDB的與此URL提到的步驟安裝在linux CentOS的服務器(SSH)的MongoDB安裝

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat/

使用命令開始的MongoDB服務器和狀態是確定。

sudo service mongod start 

When connecting mongodb with PHP (Yii app), it shows error like this. 
include(MongoClient.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory 

PHP code 

<?php 
    // connect to mongodb 
    $m = new MongoClient(); 
    echo "Connection to database successfully"; 
    // select a database 
    $db = $m->health; 
    echo "Database mydb selected"; 
    $collection = $db->medical; 
    echo "Collection selected succsessfully"; 

?> 

回答