作曲家无法识别php 5.6.4 [英] Composer not recognizing php 5.6.4

查看:94
本文介绍了作曲家无法识别php 5.6.4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经向Wamp添加了PHP 5.6.4,它可以正常工作,该图标为绿色,可以在localhost上查看我的网站。

I have added PHP 5.6.4 to Wamp and it works correctly, the icon is green and able to view my sites on localhost.

作为我们项目的一部分我需要让Composer使用我们的插件之一。当我尝试使用GitBash安装Composer时,收到此错误。

As part of our project I need to have Composer working with one of our plugins. When I try to install Composer using GitBash I receive this error.

composer install

  Problem 1
    - Installation request for illuminate/container v5.3.16 -> satisfiable by illuminate/container[v5.3.16].
    - illuminate/container v5.3.16 requires php >=5.6.4 -> your PHP version (5.5.12) does not satisfy that requirement.
  Problem 2
    - Installation request for illuminate/contracts v5.3.16 -> satisfiable by illuminate/contracts[v5.3.16].
    - illuminate/contracts v5.3.16 requires php >=5.6.4 -> your PHP version (5.5.12) does not satisfy that requirement.
  Problem 3
    - Installation request for illuminate/database v5.3.16 -> satisfiable by illuminate/database[v5.3.16].
    - illuminate/database v5.3.16 requires php >=5.6.4 -> your PHP version (5.5.12) does not satisfy that requirement.
  Problem 4
    - Installation request for illuminate/support v5.3.16 -> satisfiable by illuminate/support[v5.3.16].
    - illuminate/support v5.3.16 requires php >=5.6.4 -> your PHP version (5.5.12) does not satisfy that requirement.
  Problem 5
    - illuminate/database v5.3.16 requires php >=5.6.4 -> your PHP version (5.5.12) does not satisfy that requirement.
    - devonblzx/wp-eloquent 5.3.x-dev requires illuminate/database 5.3.* -> satisfiable by illuminate/database[v5.3.16].
    - Installation request for devonblzx/wp-eloquent 5.3.x-dev -> satisfiable by devonblzx/wp-eloquent[5.3.x-dev].

问题5指出我不满足要求的PHP版本。我需要什么才能让Composer找到所需的版本。

Problem 5 states I do not satisfy the required version of PHP. What do I need to get Composer to find the version I need.

这是我的composer.json

Here is my composer.json

{
    "name": "tours",
    "description": "Tours Package",
    "license": "Closed Source",
    "require": {
        "tourcms/tourcms-php": "3.0.*",
        "devonblzx/wp-eloquent": "5.3.x-dev"
    },
    "require-dev": {
        "psy/psysh": "0.7.*"
    },
    "suggest": {
        "tightenco/collect": "If Illuminate Support is not included, this package is required for collection support in tourcms_base"
    },
    "autoload": {
        "psr-4": {
            "": "tourcms_base/src/",
            "Discover\\": "",
            "GMaps\\": "gmaps/"
        }
    }
}


推荐答案

问题是 composer 使用在作曲家安装过程中指定的php二进制文件,而不是 W AMP 一。几种解决方案:

The problem is that composer uses that php binary which was specified during composer installation, and not the WAMP one. Several solutions:

将此添加到您的< git bash中的code>〜/ .bashrc 或〜/ .bash_profile

alias composer='path/to/php/binary composer.phar '



使git bash使用指定的PHP版本



将此添加到您的〜/ .bashrc 或git bash中的〜/ .bash_profile

Make git bash use the specified PHP version

Add this to your ~/.bashrc or ~/.bash_profile in git bash:

# Use WAMP version of PHP
PHP_VERSION=`ls /path/to/wamp/bin/php/ | sort -n | tail -1`
export PATH=/path/to/wamp/bin/php/${PHP_VERSION}/bin:$PATH



将WAMP的php的路径添加到Windows环境变量中



将PHP二进制文件的路径添加到 PATH 变量。例如:

;C:\wamp\bin\php\php5.6.4

请参见问题以获取更多信息。

See this and this questions for more info.

这篇关于作曲家无法识别php 5.6.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆