dongshi2141
dongshi2141
2016-06-22 10:42

如何使用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 douxie2029 5年前

    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

    点赞 评论 复制链接分享