$ Composer can't find mongodb extension, required Mongodb extension

前端 未结 3 1889
夕颜
夕颜 2021-02-06 08:49

I\'m using with latest php version 7.2 on macOS Mojave and receiving error like

 $composer require mongodb/mongodb
Using version ^1.4 for mongodb/mongodb
./comp         


        
3条回答
  •  别那么骄傲
    2021-02-06 09:49

    Install PHP extension by running this command on your terminal.

    sudo pecl install mongodb
    

    At the end, you will see following information.

    Build process completed successfully
    Installing '/usr/local/Cellar/php/7.3.3/pecl/20180731/mongodb.so'
    install ok: channel://pecl.php.net/mongodb-1.5.3
    Extension mongodb enabled in php.ini
    

    and then restart your PHP service.

提交回复
热议问题