doulang1945
doulang1945
2014-09-23 12:15
浏览 86
已采纳

无法通过composer安装Azure SDK for PHP

I am trying to install the Azure SDK for PHP on an Azure Website using the composer method outlines in http://azure.microsoft.com/en-us/documentation/articles/php-download-sdk/, but the composer installation has failed every time when it gets to "- Installing microsoft/windowsazure (dev-master 97e77ce)".

This is what happens every time:

Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Installing dependencies (including require-dev)
- Installing microsoft/windowsazure (dev-master 97e77ce)
Cloning 97e77ce744ecc2d3d9584b4df6982dc836489faf
Failed to download microsoft/windowsazure from source: Unable to kill the process
Now trying to download from dist
- Installing microsoft/windowsazure (dev-master 97e77ce)
Downloading: connection...
[Composer\Downloader\TransportException] The "https://api.github.com/repos/WindowsAzure/azure-sdk-for-php/zipball/97e77ce744ecc2d3d9584b4df6982dc836489faf" file could not be downloaded (HTTP/1.1 404 Not Found) install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN] 

My composer.json file:

{
"require": {
    "microsoft/windowsazure": "*"
},          
"repositories": [
    {
        "type": "pear",
        "url": "http://pear.php.net"
    }
],
"minimum-stability": "dev"
}

Does anyone know what the problem is?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doufu6504
    doufu6504 2014-10-09 06:42
    已采纳

    Managed to fix it.
    Method:

    First installed the dependencies with this composer.json:

    {
        "repositories": [
            {
                "type": "pear",
                "url": "http://pear.php.net"
            }
        ],
        "require": {
            "pear-pear.php.net/mail_mime" : "*",
            "pear-pear.php.net/http_request2" : "*",
            "pear-pear.php.net/mail_mimedecode" : "*"
        }
    }
    

    Then modified the composer.json to:

    {
        "repositories": [
            {
                "type": "pear",
                "url": "http://pear.php.net"
            },
            {
                "type": "vcs",
                "url": "https://github.com/Azure/azure-sdk-for-php"
            }
        ],
        "require": {
            "pear-pear.php.net/mail_mime" : "*",
            "pear-pear.php.net/http_request2" : "*",
            "pear-pear.php.net/mail_mimedecode" : "*",
            "microsoft/windowsazure" : "0.4.0"
        }
    }
    

    And ran composer update.
    It now works.

    点赞 评论

相关推荐