[英]how to deploy in debug mode a symfony2 app with capifony?
I have deployed my application on my website and it works finally just fine. 我已经在我的网站上部署了我的应用程序,它终于可以正常工作了。 However, I've made a second deployment with the multistage option of capifony, this one is called development as opposed to production.
但是,我使用capifony的多阶段选项进行了第二次部署,这称为开发而不是生产。
Inside my development.rb file, I have set : 在我的development.rb文件中,我设置了:
set :clear_controllers, false
设置:clear_controllers,false
so that the file app_dev.php does not get removed. 这样就不会删除文件app_dev.php。 Indeed it is available but it does not launch by default despite the following virtual host config:
实际上,它是可用的,但是尽管有以下虚拟主机配置,它默认不会启动:
<VirtualHost *:80>
ServerName test.sebastienvassaux.com
DocumentRoot /var/www/mysite.com/development/current/web
DocumentRoot /var/www/mysite.com/development/current/web
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mysite.com/development/current/web>
DirectoryIndex app_dev.php
Options -Indexes
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
So first question: how do I do for the mysite.com to load app_dev.php and not app.php ? 因此,第一个问题是:如何使mysite.com加载app_dev.php而不是app.php?
Then, if I manually enter the address mysite.com/app_dev.php, I get the following error : 然后,如果我手动输入地址mysite.com/app_dev.php,则会收到以下错误:
ClassNotFoundException in AppKernel.php line 42: Attempted to load class "SensioGeneratorBundle" from namespace "Sensio\\Bundle\\GeneratorBundle".
AppKernel.php第42行中的ClassNotFoundException:尝试从命名空间“ Sensio \\ Bundle \\ GeneratorBundle”中加载类“ SensioGeneratorBundle”。 Did you forget a "use" statement for another namespace?
您是否忘记了另一个名称空间的“使用”语句?
Well, this error is not raised when I work locally in dev mode, why is it raised here? 好吧,当我在开发模式下本地工作时,不会引发此错误,为什么在这里引发? What can I do to further understand the issue?
我该怎么做才能进一步理解该问题?
Thanks a lot! 非常感谢!
The problem is that composer has a section require-dev that is not gathered or added to the autoloader. 问题在于,作曲家的部分require-dev没有收集或添加到自动加载器中。
You can configure capifony to include the require-dev, prefrabily in you development.rb: 您可以将capifony配置为在您的development.rb中包含require-dev:
set :composer_options, "--dev --verbose --prefer-dist --optimize-autoloader --no-progress"
In conjuntion with set :clear_controllers, false
you should be able to run app_dev.php 与
set :clear_controllers, false
应该可以运行app_dev.php
Hope that it helps 希望对您有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.