你好,我是 composer mongodb 的新手,現在我正在安裝 mongodb,COMMAND PROMPT
但它給了我錯誤資訊
composer require mongodb/mongodb
錯誤:
Cannot use mongodb/mongodb's latest version 1.13.1 as it requires ext-mongodb ^1.14.0 which is missing from your platform.
In PackageDiscoveryTrait.php line 313:
Package mongodb/mongodb has requirements incompatible with your PHP version, PHP extensions and Composer version:
- mongodb/mongodb 1.13.1 requires ext-mongodb ^1.14.0 but it is not present.
我的 PHP 版本是 PHP 8.1.10
我已經試過了,但沒用
composer require mongodb/mongodb --ignore-platform-reqs
composer require jenssegers/mongodb --ignore-platform-reqs
這條訊息說沒有可發布的資源
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^1.13 for mongodb/mongodb
./composer.json has been updated
Running composer update mongodb/mongodb
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
INFO Discovering packages.
jenssegers/mongodb ................................................................................. DONE
laravel/sail ....................................................................................... DONE
laravel/sanctum .................................................................................... DONE
laravel/tinker ..................................................................................... DONE
nesbot/carbon ...................................................................................... DONE
nunomaduro/collision ............................................................................... DONE
nunomaduro/termwind ................................................................................ DONE
spatie/laravel-ignition ............................................................................ DONE
82 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php artisan vendor:publish --tag=laravel-assets --ansi --force
INFO No publishable resources for tag [laravel-assets].
No security vulnerability advisories found
uj5u.com熱心網友回復:
您必須在 php.ini 檔案中啟用 mongodb 擴展。找到 php.ini 檔案,打開它并添加以下行:extension = mongodb.so;
php.ini 檔案位于安裝 php 的位置。例如在 Windows 上它可以是 C:/php/php.ini
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/534844.html
標籤:拉维数据库作曲家-PHP
