部署到Azure时,Composer.phar安装无法完成

时间:2016-11-17 21:01:57

标签: symfony azure composer-php

我正在尝试将我的Symfony应用程序部署到Microsoft Azure。 我已经创建了一个服务计划App,确保PHP是v5.6(我在本地开发了应用程序),添加了php_intl.dll扩展,从Git推送文件以及运行时__ php -d extension = php_intl.dll composer安装供应商后.phar install __我得到以下错误。我在云Kudu命令控制台中运行此命令。

我做错了什么?我该如何部署? Symfony.com上的指南有点过时,但直到这一步才让我知道。

Generating autoload files
Deprecation Notice: The callback Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap declared at D:\home\site\wwwroot\vendor\sensio\distribution-bundle\Composer\ScriptHandler.php accepts a Composer\Script\CommandEvent but post-install-cmd events use a Composer\Script\Event instance. Please adjust your type hint accordingly, see https://getcomposer.org/doc/articles/scripts.md#event-classes in phar://D:/home/site/wwwroot/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:290
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
Deprecation Notice: The callback Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache declared at D:\home\site\wwwroot\vendor\sensio\distribution-bundle\Composer\ScriptHandler.php accepts a Composer\Script\CommandEvent but post-install-cmd events use a Composer\Script\Event instance. Please adjust your type hint accordingly, see https://getcomposer.org/doc/articles/scripts.md#event-classes in phar://D:/home/site/wwwroot/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:290The symfony-bin-dir (bin) specified in composer.json was not found in D:\home\site\wwwroot, can not clear the cache.
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
Deprecation Notice: The callback Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets declared at D:\home\site\wwwroot\vendor\sensio\distribution-bundle\Composer\ScriptHandler.php accepts a Composer\Script\CommandEvent but post-install-cmd events use a Composer\Script\Event instance. Please adjust your type hint accordingly, see https://getcomposer.org/doc/articles/scripts.md#event-classes in phar://D:/home/site/wwwroot/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:290
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets
Deprecation Notice: The callback Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile declared at D:\home\site\wwwroot\vendor\sensio\distribution-bundle\Composer\ScriptHandler.php accepts a Composer\Script\CommandEvent but post-install-cmd events use a Composer\Script\Event instance. Please adjust your type hint accordingly, see https://getcomposer.org/doc/articles/scripts.md#event-classes in phar://D:/home/site/wwwroot/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:290
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile

The symfony-bin-dir (bin) specified in composer.json was not found in D:\home\site\wwwroot, can not install assets.
The symfony-bin-dir (bin) specified in composer.json was not found in D:\home\site\wwwroot, can not install the requirements files.
Deprecation Notice: The callback Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget declared at D:\home\site\wwwroot\vendor\sensio\distribution-bundle\Composer\ScriptHandler.php accepts a Composer\Script\CommandEvent but post-install-cmd events use a Composer\Script\Event instance. Please adjust your type hint accordingly, see https://getcomposer.org/doc/articles/scripts.md#event-classes in phar://D:/home/site/wwwroot/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:290
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget

Composer.json文件:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-4": { "": "src/" },
        "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
    },
    "autoload-dev": {
        "psr-4": { "Tests\\": "tests/" }
    },
    "require": {
        "php": ">=5.5.9",
        "symfony/symfony": "3.0.*",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "symfony/swiftmailer-bundle": "^2.3",
        "symfony/monolog-bundle": "^2.8",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0",
        "symfony/console": "^3.0",
        "symfony/assetic-bundle": "^2.7",
        "symfony/security": "^3.0",
        "knplabs/knp-menu-bundle": "^2.1",
        "twbs/bootstrap": "^3.3",
        "gregwar/captcha-bundle": "^2.0",
        "friendsofsymfony/rest-bundle": "^1.7",
        "jms/serializer-bundle": "^1.1",
        "ci/restclientbundle": "^1.0",
        "eightpoints/guzzle-bundle": "^4.4",
        "jasongrimes/paginator": "^1.0",
        "knplabs/knp-paginator-bundle": "^2.5",
        "liip/imagine-bundle": "^1.5",
        "symfony/dependency-injection": "^3.0",
        "sensio/generator-bundle": "^3.0",
        "symfony/event-dispatcher": "^3.0",
        "friendsofsymfony/jsrouting-bundle": "^1.6",
        "league/oauth2-client": "^1.4",
        "league/oauth2-facebook": "^1.4"

    },
    "require-dev": {
        "symfony/phpunit-bridge": "^2.7"
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ]
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "3.0-dev"
        }
    }
}

2 个答案:

答案 0 :(得分:0)

我从未部署在Microsoft Azure上,但到目前为止看起来某些资源并不是他们所期望的。看看你的composer.json

答案 1 :(得分:0)

您需要确保.gitignore文件具有以下内容,以便composer知道需要安装哪些要求

!bin/console
!bin/symfony_requirements

由gitignore / Symfony.gitignore here

记录