dongshi2141 2016-06-22 10:42
浏览 38
已采纳

如何使用PHP连接MongoDB 1.1.7版?

Previously I was using mongo 1.4 version in PHP. But now I have upgraded to MongoDB 1.1.7. So, I am using following code to connect with mongoDB.

  $mongo = new MongoClient();

But I am getting following error:

  Class 'MongoClient' not found

Please suggest me to reslove this error.

  • 写回答

1条回答 默认 最新

  • douxie2029 2016-06-22 10:57
    关注

    I'll assume you meant you upgraded from 1.1.7 to 1.4?

    According to PHP.net, MongoClient is deprecated in versions past 1.3.0. Use MongoDB\Driver\Manager instead.

    http://php.net/manual/en/class.mongoclient.php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?