Laravel Forge部署环境变量问题
Laravel Forge Deployment environment variable issue
我的应用程序将无法部署,因为它缺少必需的环境变量。
当我在 Forge 中设置这些时,它们会出现。我一点击部署它们就全部消失了,然后我的部署失败了。
我正在将 Symfony2 与 Digital Ocean 一起使用 - 但应该不会有什么不同,问题是所有环境变量在部署之前都会被删除。不会吧?
这是来自 Symfony 的错误消息,但这是由于未设置环境变量(在 forge 中我可以看到它在部署前被删除)
- Installing tedivm/stash-bundle (v0.4.2)
Loading from cache
- Installing twig/extensions (v1.2.0)
Loading from cache
Generating autoload files
Creating the "app/config/parameters.yml" file
PHP Fatal error: Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /home/forge/beta.dashboardhub.io/app/AppKernel.php on line 31
PHP Stack trace:
PHP 1. {main}() /home/forge/beta.dashboardhub.io/app/console:0
PHP 2. Symfony\Component\Console\Application->run() /home/forge/beta.dashboardhub.io/app/console:27
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
PHP 4. Symfony\Component\HttpKernel\Kernel->boot() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
PHP 5. Symfony\Component\HttpKernel\Kernel->initializeBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2343
PHP 6. AppKernel->registerBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2513
Fatal error: Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /home/forge/beta.dashboardhub.io/app/AppKernel.php on line 31
Call Stack:
0.0002 225112 1. {main}() /home/forge/beta.dashboardhub.io/app/console:0
0.0253 3126784 2. Symfony\Component\Console\Application->run() /home/forge/beta.dashboardhub.io/app/console:27
0.0279 3329440 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
0.0279 3329664 4. Symfony\Component\HttpKernel\Kernel->boot() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
0.0279 3329960 5. Symfony\Component\HttpKernel\Kernel->initializeBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2343
0.0279 3330560 6. AppKernel->registerBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2513
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
这是 Forge 的问题/功能。它确实会在部署之前重置环境变量。
这是他们支持的回复...
Yeah that has been a point of confusion I will fix today. Basically
the original thought was if you are installing a new project you will
want new environment variables, but many people set the environment
variables before installing.
Taylor Otwell
所以看起来很快就会修复。
我找不到 Forge Ticket、Twitter 帐户或部署更改日志来跟踪此进度。
临时解决方案/解决方法
No there is not currently a deployment change log. I will let you know
when it is ready to go. It’s a little trickier than it sounds… for
now, you could install the project and just un-check the “Install
Composer” step, then add your environment variables, then click the
“Deploy” button so it picks up the composer install step.
Taylor Otwell
我的应用程序将无法部署,因为它缺少必需的环境变量。
当我在 Forge 中设置这些时,它们会出现。我一点击部署它们就全部消失了,然后我的部署失败了。
我正在将 Symfony2 与 Digital Ocean 一起使用 - 但应该不会有什么不同,问题是所有环境变量在部署之前都会被删除。不会吧?
这是来自 Symfony 的错误消息,但这是由于未设置环境变量(在 forge 中我可以看到它在部署前被删除)
- Installing tedivm/stash-bundle (v0.4.2)
Loading from cache
- Installing twig/extensions (v1.2.0)
Loading from cache
Generating autoload files
Creating the "app/config/parameters.yml" file
PHP Fatal error: Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /home/forge/beta.dashboardhub.io/app/AppKernel.php on line 31
PHP Stack trace:
PHP 1. {main}() /home/forge/beta.dashboardhub.io/app/console:0
PHP 2. Symfony\Component\Console\Application->run() /home/forge/beta.dashboardhub.io/app/console:27
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
PHP 4. Symfony\Component\HttpKernel\Kernel->boot() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
PHP 5. Symfony\Component\HttpKernel\Kernel->initializeBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2343
PHP 6. AppKernel->registerBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2513
Fatal error: Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /home/forge/beta.dashboardhub.io/app/AppKernel.php on line 31
Call Stack:
0.0002 225112 1. {main}() /home/forge/beta.dashboardhub.io/app/console:0
0.0253 3126784 2. Symfony\Component\Console\Application->run() /home/forge/beta.dashboardhub.io/app/console:27
0.0279 3329440 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
0.0279 3329664 4. Symfony\Component\HttpKernel\Kernel->boot() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
0.0279 3329960 5. Symfony\Component\HttpKernel\Kernel->initializeBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2343
0.0279 3330560 6. AppKernel->registerBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2513
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
这是 Forge 的问题/功能。它确实会在部署之前重置环境变量。
这是他们支持的回复...
Yeah that has been a point of confusion I will fix today. Basically the original thought was if you are installing a new project you will want new environment variables, but many people set the environment variables before installing.
Taylor Otwell
所以看起来很快就会修复。
我找不到 Forge Ticket、Twitter 帐户或部署更改日志来跟踪此进度。
临时解决方案/解决方法
No there is not currently a deployment change log. I will let you know when it is ready to go. It’s a little trickier than it sounds… for now, you could install the project and just un-check the “Install Composer” step, then add your environment variables, then click the “Deploy” button so it picks up the composer install step.
Taylor Otwell