一.准备工作
1.php7.0以上,如果是本地配置推荐 phpStudySetup2018 方便快捷好用。查看 phpinfo
注意:php7.0以上需要 vc14(32位) ,Architecture x86是32位(这个是后面配置MongoDB选择32位或64位的依据,不是操作系统的哦)
二.下载mongodb配置文件
php7.0以上配置MongoDB环境,phpx86 结构环境(不是操作系统的环境)。打开phpinfo查看 Architecture
php_mongodb-1.2.9-7.1-nts-vc14-x86
解压php_mongodb-1.2.9-7.1-nts-vc14-x86,把php_mongodb.dll复制到php\ext下
打开php.ini配置文件,添加一行 extension=php_mongodb.dll 重新启动php
三.注意事项
打开phpinfo查看 Architecture x86Architecture 和 php_mongodb 要一样php_mongodb-1.2.9-7.1-nts-vc14-x86