简体   繁体   中英

Laravel 5.4 with MongoDB MAC Mojave

Hello I having trouble to to install "jenssegers/mongodb": "^3.2" on my local environment.

i have this error: 在此处输入图片说明

I have added to my /etc/php.ini full path to extentions="/usr/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so"

restart the php and apache

I have try to find mongodb.ini, fail on that.

I try all the tutorial is google... still no luck

Can any one help me please?

PHP 7.1.23 (cli) (built: Feb 22 2019 22:08:13) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

It seems that you forgot to install MongoDB PHP Driver itself.

To do that just install it with pecl :

sudo pecl install mongodb-1.5.3

1.5.3 is the last stable version, so I'd recommend to use it rather than the most recent 1.6.0alpha.

Then, don't forget to add it to your php.ini (run php --ini to see where it's located):

extension=mongodb.so

To test that it works just run:

php -m | grep mongo

If you see mongodb in output, then it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM