0

I just installed the mongodb on my mac pc. If I run this command:

php --ri mongodb

I can see it's successfully installed:

mongodb

MongoDB support => enabled
MongoDB extension version => 1.14.1
MongoDB extension stability => stable
libbson bundled version => 1.22.1
libmongoc bundled version => 1.22.1
libmongoc SSL => enabled
libmongoc SSL library => Secure Transport
libmongoc crypto => enabled
libmongoc crypto library => Common Crypto
libmongoc crypto system profile => disabled
libmongoc SASL => enabled
libmongoc ICU => disabled
libmongoc compression => enabled
libmongoc compression snappy => disabled
libmongoc compression zlib => enabled
libmongoc compression zstd => enabled
libmongocrypt bundled version => 1.5.2
libmongocrypt crypto => enabled
libmongocrypt crypto library => Common Crypto

Directive => Local Value => Master Value
mongodb.debug => no value => no value

But using the phpinfo() output I can't see it's installed. I also add this:

extension="/usr/local/Cellar/php/8.1.11/pecl/20210902/mongodb.so"

to php.ini file.

Any idea?

Shibbir
  • 1,963
  • 2
  • 25
  • 48

1 Answers1

1

As per our discussion , Your server is using different php version then your cli, CLI has installed mongodb in php 8.1 and server is using php 7.4

to change php version MAMP is using please refer to this answer

https://stackoverflow.com/a/44384509/12987235

Or you can use the mamp's php in cli, refer below link to use mamp's PHP https://www.choosepizzi.net/mamp-lets-make-terminal-use-mamps-php-instead-of-macs-version/


Rudra
  • 704
  • 8
  • 16