繁体   English   中英

无法将我的symfony应用程序部署到heroku

[英]Can not deploy my symfony app to heroku

当我尝试将symfony应用程序部署到heroku时,部署失败,因为它无法连接到数据库。 我已经创建了一个parameters.dist.yml文件,该文件在部署期间由作曲家读取以创建parameters.yml文件。 我已经确认参数正确,并且可以从本地计算机连接到JawsDB数据库。 我可能做错了什么?

请参见下面来自heroku的回复:

git push heroku master
Counting objects: 736, done.
Compressing objects: 100% (351/351), done.
Writing objects: 100% (698/698), 808.13 KiB | 0 bytes/s, done.
Total 698 (delta 340), reused 597 (delta 285)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote:        - php (7.1.3)
remote:        - apache (2.4.20)
remote:        - nginx (1.8.1)
remote:
remote:  !     WARNING: Your 'composer.lock' is not up to date with the latest
remote:        changes in 'composer.json'. To ensure you are not getting stale
remote:        dependencies, run 'composer update' on your machine and commit
remote:        any changes to Git before pushing again.
remote:
remote: -----> Installing dependencies...
remote:        Composer version 1.4.1 2017-03-10 09:29:45
remote:        Loading composer repositories with package information
remote:        Installing dependencies from lock file
remote:        Package operations: 48 installs, 0 updates, 0 removals
remote:          - Installing crell/api-problem (2.0): Downloading (100%)
remote:          - Installing doctrine/lexer (v1.0.1): Loading from cache
remote:          - Installing doctrine/annotations (v1.2.7): Loading from cache
remote:          - Installing twig/twig (v1.32.0): Downloading (100%)
remote:          - Installing symfony/polyfill-util (v1.3.0): Downloading (100%)
remote:          - Installing paragonie/random_compat (v2.0.9): Downloading (100%)
remote:          - Installing symfony/polyfill-php70 (v1.3.0): Downloading (100%)
remote:          - Installing symfony/polyfill-php56 (v1.3.0): Downloading (100%)
remote:          - Installing symfony/polyfill-mbstring (v1.3.0): Downloading (100%)
remote:          - Installing symfony/symfony (v3.1.10): Downloading (100%)
remote:          - Installing symfony/polyfill-intl-icu (v1.3.0): Downloading (100%)
remote:          - Installing psr/log (1.0.2): Loading from cache
remote:          - Installing psr/cache (1.0.1): Loading from cache
remote:          - Installing doctrine/inflector (v1.1.0): Loading from cache
remote:          - Installing doctrine/collections (v1.3.0): Loading from cache
remote:          - Installing doctrine/cache (v1.6.1): Loading from cache
remote:          - Installing doctrine/common (v2.6.2): Downloading (100%)
remote:          - Installing doctrine/doctrine-cache-bundle (1.3.0): Loading from cache
remote:          - Installing zendframework/zend-eventmanager (3.0.1): Downloading (100%)
remote:          - Installing zendframework/zend-code (2.6.3): Downloading (100%)
remote:          - Installing ocramius/proxy-manager (1.0.2): Downloading (100%)
remote:          - Installing doctrine/dbal (v2.5.12): Downloading (100%)
remote:          - Installing doctrine/migrations (v1.5.0): Downloading (100%)
remote:          - Installing jdorn/sql-formatter (v1.2.17): Loading from cache
remote:          - Installing doctrine/doctrine-bundle (1.6.7): Downloading (100%)
remote:          - Installing doctrine/doctrine-migrations-bundle (v1.2.1): Downloading (100%)
remote:          - Installing doctrine/instantiator (1.0.5): Loading from cache
remote:          - Installing doctrine/orm (v2.5.6): Downloading (100%)
remote:          - Installing willdurand/negotiation (v2.2.1): Downloading (100%)
remote:          - Installing willdurand/jsonp-callback-validator (v1.1.0): Downloading (100%)
remote:          - Installing friendsofsymfony/rest-bundle (2.1.1): Downloading (100%)
remote:          - Installing incenteev/composer-parameter-handler (v2.1.2): Loading from cache
remote:          - Installing jms/metadata (1.6.0): Downloading (100%)
remote:          - Installing phpoption/phpoption (1.5.0): Downloading (100%)
remote:          - Installing jms/parser-lib (1.0.0): Downloading (100%)
remote:          - Installing phpcollection/phpcollection (0.5.0): Downloading (100%)
remote:          - Installing jms/serializer (1.5.0): Downloading (100%)
remote:          - Installing jms/serializer-bundle (1.2.0): Downloading (100%)
remote:          - Installing michelf/php-markdown (1.7.0): Downloading (100%)
remote:          - Installing nelmio/api-doc-bundle (2.13.1): Downloading (100%)
remote:          - Installing sensiolabs/security-checker (v4.0.1): Downloading (100%)
remote:          - Installing sensio/distribution-bundle (v5.0.18): Downloading (100%)
remote:          - Installing sensio/framework-extra-bundle (v3.0.23): Downloading (100%)
remote:          - Installing monolog/monolog (1.22.0): Downloading (100%)
remote:          - Installing symfony/monolog-bundle (v2.12.1): Downloading (100%)
remote:          - Installing symfony/polyfill-apcu (v1.3.0): Downloading (100%)
remote:          - Installing swiftmailer/swiftmailer (v5.4.6): Downloading (100%)
remote:          - Installing symfony/swiftmailer-bundle (v2.5.3): Downloading (100%)
remote:        Generating optimized autoload files
remote:        > Incenteev\ParameterHandler\ScriptHandler::buildParameters
remote:        Creating the "app/config/parameters.yml" file
remote:        > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
remote:        > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
remote:
remote:
remote:          [Doctrine\DBAL\Exception\ConnectionException]
remote:          An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
remote:
remote:
remote:
remote:          [Doctrine\DBAL\Driver\PDOException]
remote:          SQLSTATE[HY000] [2002] Connection refused
remote:
remote:
remote:
remote:          [PDOException]
remote:          SQLSTATE[HY000] [2002] Connection refused
remote:
remote:
remote:        Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
remote:
remote:
remote:          [RuntimeException]
remote:          An error occurred when executing the "'cache:clear --no-warmup'" command:
remote:
remote:            [Doctrine\DBAL\Exception\ConnectionException]
remote:            An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
remote:
remote:
remote:            [Doctrine\DBAL\Driver\PDOException]
remote:            SQLSTATE[HY000] [2002] Connection refused
remote:
remote:
remote:            [PDOException]
remote:            SQLSTATE[HY000] [2002] Connection refused
remote:
remote:          .
remote:
remote:
remote:        install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
remote:
remote:  !     Push rejected, failed to compile PHP app.
remote:
remote:  !     Push failed

SQLSTATE[HY000] [2002] Connection refused似乎表明它正在尝试连接到本地主机,但是在我的parameters.yml文件中,我包含了正确的连接详细信息。

似乎我正在尝试将master分支部署到herkou而不是active分支。 要部署我运行的指定分支:

git push heroku <branch>:master

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM