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 uses guzzle which needs php>=5.3.3 and curl extension

Do the following:

  • update composer: composer self-update
  • check php version: php -v
  • install curl extension: [sudo] apt-get install php5-curl

And if you use windows then try these:

If you still get an error with composer require ...

  • If exists, remove "composer.lock" file from you project's root directory.
  • Create a "composer.json" file on your project's root directory as below.
  • Run composer install

// composer.json:

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

composer require mailgun/mailgun-php:~1.7.1

私のために働いた - Windows、XAMPP。

php.ini を見つけて、extension=php_curl.dll のコメントを外します。

于 2015-02-11T18:32:51.163 に答える