使用composer添加照明/数据库依赖关系

Hey Guys trying to add illuminate/database dependence to my project but i get an error. heres what i did and get

C:\wamp\www\xxxxxxxxxxxx>php composer.phar require illuminate/database
Using version ^5.1 for illuminate/database ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) 
Your requirements could not be resolved to an installable set of packages.
Problem 1
- illuminate/database v5.1.1 requires illuminate/support 5.1.* -> satisfiabl
e by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22,v5.1.6, v5.1.8].
- illuminate/database v5.1.13 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.6, v5.1.8].
- illuminate/database v5.1.16 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.6, v5.1.8].
- illuminate/database v5.1.2 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.6, v5.1.8].
- illuminate/database v5.1.20 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.6, v5.1.8].
- illuminate/database v5.1.22 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.6, v5.1.8].
- illuminate/database v5.1.6 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.6, v5.1.8].
- illuminate/database v5.1.8 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.6, v5.1.8].
- illuminate/support v5.1.8 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- illuminate/support v5.1.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- illuminate/support v5.1.22 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- illuminate/support v5.1.20 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- illuminate/support v5.1.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- illuminate/support v5.1.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- illuminate/support v5.1.13 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- illuminate/support v5.1.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
- Installation request for illuminate/database ^5.1 -> satisfiable by illuminate/database[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.6, v5.1.8].

Installation failed, reverting ./composer.json to its original content.

It is pretty much obvious that you need to install the mbstring extention. Just go to your php.ini and uncomment the

extension=php_mbstring.dll

line.

You have mentioned 5.1.* for version (for illuminate) in your composer.json making it ambiguous. You need to specify a particular version like for e.g. 5.1.16 to remove the ambiguity in the version. Also extension=php_mbstring.dll your extension mbstring is missing.

Hope that helps.

Your command line version of PHP is missing the mbstring extension.

Run php -i to get the info data. Find the part that tells you which php.ini file has been used. Edit this file to add the extension. Run the composer command again. It should work.

Note that the CLI PHP usually uses a different INI file than PHP of the webserver. Additionally, CLI PHP need not to be restarted, because it isn't part of a constantly running process.

Example from my machine (excerpt):

Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => C:\Program Files (x86)\PHP\php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)