1

我一直在尝试使用 composer 在我的本地主机中安装 mailgun 库。我在命令提示符中写了以下命令:

php composer require mailgun/mailgun-php:~1.3

它给了我错误Could not open input file: composer

然后我尝试删除php上一个命令开头的 :

composer require mailgun/mailgun-php:~1.3

表明:

./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
- The requested package mailgun/mailgun-php 1.0.0 could not be found.
Problem 2
- guzzle/guzzle v3.7.4 requires ext-curl * -> the requested PHP extension cu
rl is missing from your system.
- guzzle/guzzle v3.7.3 requires ext-curl * -> the requested PHP extension cu
rl is missing from your system.
- guzzle/guzzle v3.7.2 requires ext-curl * -> the requested PHP extension cu
rl is missing from your system.
- guzzle/guzzle v3.7.1 requires ext-curl * -> the requested PHP extension cu
rl is missing from your system.
- guzzle/guzzle v3.7.0 requires ext-curl * -> the requested PHP extension cu
rl is missing from your system.
- Installation request for guzzle/guzzle 3.7.* -> satisfiable by guzzle/guzz
le[v3.7.0, v3.7.1, v3.7.2, v3.7.3, v3.7.4].

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

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
problems.

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

这几天我一直在努力安装mailgun,请帮助我。

更新:

仅供参考:我正在使用使用 xampp 的 Windows

composer.phar 文件详细信息:

{
"name": "mailgun/mailgun-php",
"description": "The Mailgun SDK provides methods for all API functions.",
"require": {
    "guzzle/guzzle": "3.7.*"
},
"require-dev": {
    "phpunit/phpunit": "3.7.*"
},
"autoload": {
    "psr-0": {
        "Mailgun\\Tests": "tests/",
        "Mailgun": "src/"
    }
},
"license": "MIT",
"authors": [
    {
        "name": "Travis Swientek",
        "email": "travis@mailgunhq.com"
    }
],
"minimum-stability": "stable"
}
4

2 回答 2

3

mailgun 使用 guzzle 需要php>=5.3.3curl 扩展

请执行下列操作:

  • 更新作曲家:composer self-update
  • 检查php版本:php -v
  • 安装 curl 扩展:[sudo] apt-get install php5-curl

如果您使用 Windows,请尝试以下操作:

如果您仍然遇到错误composer require ...

  • 如果存在,请从项目的根目录中删除“composer.lock”文件。
  • 在项目的根目录中创建一个“composer.json”文件,如下所示。
  • composer install

// 作曲家.json:

{
    "require": {
        "mailgun/mailgun-php": "~1.5"
    }
}
于 2014-01-06T12:55:53.503 回答
1

作曲家需要 mailgun/mailgun-php:~1.7.1

为我工作-Windows,XAMPP。

找到您的 php.ini 并取消注释 extension=php_curl.dll。

于 2015-02-11T18:32:51.163 回答