编写器无法识别php 5.6.4



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

作为我们项目的一部分,我需要有作曲家与我们的一个插件工作。当我尝试使用GitBash安装Composer时,我收到此错误。

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找到我需要的版本。

这是我的作曲家。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二进制文件,而不是WAMP的那个。几种解决方案:

重写git bash中composer(或php)的别名

将此添加到git bash中的~/.bashrc~/.bash_profile:

alias composer='path/to/php/binary composer.phar '
让git bash使用指定的PHP版本

~/.bashrc~/.bash_profile添加到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:wampbinphpphp5.6.4

相关内容

  • 没有找到相关文章

最新更新