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

时间:2015-11-09 10:16:58

标签: php composer-php

嘿伙计们试图为我的项目添加照明/数据库依赖但我收到错误。继承人我做了什么,得到了

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.

3 个答案:

答案 0 :(得分:2)

很明显,您需要安装mbstring扩展。只需转到您的php.ini并取消注释

var fileTransfer; var uri = encodeURI("http://localhost:8000/js/test.txt"); document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { fileTransfer = new FileTransfer(); fileTransfer.download( uri, cordova.file.dataDirectory + 'test.txt', function(entry) { console.log("download complete: " + entry.toURL()); }, function(error) { console.log("download error source " + error.source); console.log("download error target " + error.target); console.log("upload error code" + error.code); }, false ); }

线。

答案 1 :(得分:0)

PHP的命令行版本缺少mbstring扩展名。

运行php -i以获取信息数据。找到告诉您哪个php.ini文件已被使用的部分。编辑此文件以添加扩展名。再次运行composer命令。它应该工作。

请注意,CLI PHP通常使用与Web服务器的PHP不同的INI文件。此外,CLI PHP不需要重新启动,因为它不是一个持续运行的进程的一部分。

我的机器示例(摘录):

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)

答案 2 :(得分:-2)

你在composer.json中为版本(用于照亮)提到了5.1。*,使其模糊不清。您需要指定特定版本,例如5.1.16删除版本中的歧义。此外extension=php_mbstring.dll你的扩展名mbstring也丢失了。

希望有所帮助。