【问题标题】:Allow composer to install laravel 4 and detect MAMP's PHP version not system允许 composer 安装 laravel 4 并检测 MAMP 的 PHP 版本不是系统
【发布时间】:2014-12-03 18:32:40
【问题描述】:

作曲家等新手,遇到了问题。

当尝试使用以下方式下载所有文件时:

composer create laravel/laravel laravelNew

我看到这个错误:

Installing laravel/laravel (v4.2.0)
- Installing laravel/laravel (v4.2.0)
Loading from cache

Created project in laravelNew
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- laravel/framework v4.2.9 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.8 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.7 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.6 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.5 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.4 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.3 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.2 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.11 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.10 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.1 requires php >=5.4.0 -> no matching package found.
- laravel/framework v4.2.0 requires php >=5.4.0 -> no matching package found.
- Installation request for laravel/framework 4.2.* -> satisfiable by laravel/framework[v4.2.0, v4.2.1, v4.2.10, v4.2.11, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9].

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

我在安装了 PHP 5.3 的 mac 上,这在执行 php -v 时得到了确认

PHP 5.3.26 (cli) (built: Jul  7 2013 18:30:38) 

但是,我使用 MAMP 在本地运行我的网站。

有没有办法让作曲家改为检查 MAMP php 版本?由于 MAMP PHP 版本是 5.4+

谢谢。克雷格。

【问题讨论】:

  • 您应该升级 PHP 的 CLI 版本以匹配 MAMP 版本。也许 MAMP 还提供了一个您可以链接到的 CLI 版本。不是 Mac 用户,我无法提出解决方案。但是,不能让 Composer 认为它在不同的 PHP 版本下运行,因此您最后一个问题的答案是“否”。

标签: php laravel laravel-4 composer-php


【解决方案1】:

您应该告诉您的 mac 使用与 Mamp 一起使用的最新版本的 php。您可以在 .bash_profile 中执行此操作。

查看此post 了解更多信息。

【讨论】:

    猜你喜欢
    • 2016-08-04
    • 1970-01-01
    • 1970-01-01
    • 2013-05-03
    • 2014-05-27
    • 2017-03-07
    • 1970-01-01
    • 2015-12-22
    • 1970-01-01
    相关资源
    最近更新 更多