Noo*_*oor 33 deployment production-environment symfony
有人可以帮助我将Symfony 2应用程序转移到生产模式吗?
目前,该应用程序正常运行/app_dev.php
.
我正在谷歌搜索,但我没有找到在Symfony 2部署的明确指南.
Cer*_*rad 55
要考虑更多的事情:
php app/console cache:clear --env=prod --no-debug
php app/console assets:install web_directory
php app/console assetic:dump web_directory
Run Code Online (Sandbox Code Playgroud)
您可能还会遇到缓存目录的权限问题.在切换到生产模式之前,我实际上首先要确保服务器上的所有内容都在开发模式下工作.如果你得到的只是生产模式下的空白屏幕,那么将debug设置为true.当然知道如何检查错误日志.
Cho*_*hop 11
将Symfony2移至生产意味着:
通过以下方式访问应用程序:app.php /
由于在使用app.php时AppKernel.php中存在条件,因此不会加载测试开发包.如果要卸载仅应在dev中使用的bundle,可以将它们放入本节(在appKernel.php中)
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Sf2gen\Bundle\GeneratorBundle\Sf2genGeneratorBundle();
}
Run Code Online (Sandbox Code Playgroud)
您还需要通过激活xdebug并添加eacclerator(或其他用于缓存性能)来进行一些服务器调整
我还建议重命名app_dev.php以禁用开发模式
归档时间: |
|
查看次数: |
43812 次 |
最近记录: |