Blogger Information
Blog 8
fans 0
comment 1
visits 10262
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
thinkphp5.0.9连接mongo的相关配置
Moments的博客
Original
563 people have browsed it
  1. thinkphp5.0配置数据库,一般情况下在application/database.php中配置数据库信息,在application/config.php中配置第二数据库信息,在这里我们在config.php中配置mongodb信息;

    QQ图片20171016134953.png

  2. 在官网下载与php版本对应的php_mongodb.dll扩展,一般分为ts和nts,x86和64位,根据需要选择,下载网址为:

    http://pecl.php.net/package/mongo;

  3. 安装扩展下载好后打开压缩包会发现php_mongodb.dll文件,将其复制到:E:\PHP\wamp64\bin\php\php5.6.25\ext(你的php路径)这个路径的文件夹下,并在php.ini中添加:extension=php_mongodb.dll,重启apache

  4. 用phpinfo()函数测试是否安装成功,出现mongodb字样说明安装成功

  5. 如何没出现mongodb字样可以尝试换低一点版本的扩展,重启电脑

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!