我一直在尝试使用作曲家在我的本地主机中安装邮件枪库。我在命令提示符下编写了以下命令:
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的窗口
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"
}
mailgun 使用 guzzle 需要 php>=5.3.3 和 curl 扩展
执行以下操作:
- 更新作曲家:
composer self-update
- 检查PHP版本:
php -v
- 安装 curl 扩展:
[sudo] apt-get install php5-curl
如果您使用Windows,请尝试以下方法:
- 万普卷曲安装
- 如何在 xampp 中启用卷曲?
- 如何在 Windows 上安装 cURL?
如果仍然收到错误composer require ...
- 如果存在,请从项目的根目录中删除"composer.lock"文件。
- 在项目的根目录上创建一个"composer.json"文件,如下所示。
- 运行
composer install
//composer.json:
{
"require": {
"mailgun/mailgun-php": "~1.5"
}
}
作曲家需要 mailgun/mailgun-php:~1.7.1
为我工作 - Windows,XAMPP。
找到你的 php.ini 并取消注释 extension=php_curl.dll。