php5和php7的mongo扩展不一样,php5的时候是mongo.so,php7是mongodb.so(https://github.com/mongodb/mongo-php-driver/),安装完以后可能会报错,这个驱动最新版(1.5)只支持3.0+的mongo server,如果你的mongo server还停留在2.4、2.6的话是不支持的(会报错:Server at xxxx:xxxx reports wire version 0, but this version of libmongoc requires at least 3 (MongoDB 3.0)),需要使用1.2版本的驱动(https://github.com/mongodb/mongo-php-library/tags)。
这个文章写得也不错:https://blog.csdn.net/u010615629/article/details/80757079