• <i id='NnWmQ'><tr id='NnWmQ'><dt id='NnWmQ'><q id='NnWmQ'><span id='NnWmQ'><b id='NnWmQ'><form id='NnWmQ'><ins id='NnWmQ'></ins><ul id='NnWmQ'></ul><sub id='NnWmQ'></sub></form><legend id='NnWmQ'></legend><bdo id='NnWmQ'><pre id='NnWmQ'><center id='NnWmQ'></center></pre></bdo></b><th id='NnWmQ'></th></span></q></dt></tr></i><div id='NnWmQ'><tfoot id='NnWmQ'></tfoot><dl id='NnWmQ'><fieldset id='NnWmQ'></fieldset></dl></div>
      <bdo id='NnWmQ'></bdo><ul id='NnWmQ'></ul>

    <tfoot id='NnWmQ'></tfoot>
    1. <legend id='NnWmQ'><style id='NnWmQ'><dir id='NnWmQ'><q id='NnWmQ'></q></dir></style></legend>

      1. <small id='NnWmQ'></small><noframes id='NnWmQ'>

      2. 为什么我访问 app.php 时 Symfony2 安装 404ing?

        时间:2024-08-14
          • <bdo id='av8FM'></bdo><ul id='av8FM'></ul>
                <i id='av8FM'><tr id='av8FM'><dt id='av8FM'><q id='av8FM'><span id='av8FM'><b id='av8FM'><form id='av8FM'><ins id='av8FM'></ins><ul id='av8FM'></ul><sub id='av8FM'></sub></form><legend id='av8FM'></legend><bdo id='av8FM'><pre id='av8FM'><center id='av8FM'></center></pre></bdo></b><th id='av8FM'></th></span></q></dt></tr></i><div id='av8FM'><tfoot id='av8FM'></tfoot><dl id='av8FM'><fieldset id='av8FM'></fieldset></dl></div>
                <legend id='av8FM'><style id='av8FM'><dir id='av8FM'><q id='av8FM'></q></dir></style></legend>

                <small id='av8FM'></small><noframes id='av8FM'>

                <tfoot id='av8FM'></tfoot>

                    <tbody id='av8FM'></tbody>
                1. 本文介绍了为什么我访问 app.php 时 Symfony2 安装 404ing?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 Symfony2 中,当通过 app_dev.php 在本地访问我的应用程序时,一切正常.但是,当我访问 app.php 时,它是 404s:

                  In Symfony2, when accessing my application locally via app_dev.php, everything works fine. However, when I access app.php it 404s:

                  哎呀!发生错误

                  服务器返回404 Not Found".

                  The server returned a "404 Not Found".

                  有些东西坏了.请在 [email] 给我们发电子邮件,让我们知道什么发生此错误时您正在做的事情.我们会尽快修复可能的.对不起

                  Something is broken. Please e-mail us at [email] and let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for

                  推荐答案

                  全新的 symfony 2 安装不包含任何用于生产环境的路由.如果您查看 app/config/routing_dev.yml 下的内容,您会注意到您在演示应用程序中看到的所有路由都是为开发而定义的.如果你想在 app.php 上测试 demo,你必须先将路由从 routing_dev.yml 复制到 routing.yml,然后还启用 AppKernel.php 下的 AcmeDemoBundle:

                  A fresh symfony 2 install does not contain any routing for the production environment. If you take a look under app/config/routing_dev.yml, you will notice that all of the routes that you see in the demo application are defined only for development. If you wish to test the demo on app.php, you have to first copy the routing from routing_dev.yml to routing.yml, and also enable the AcmeDemoBundle under you AppKernel.php:

                  $bundles = array(
                          new SymfonyBundleFrameworkBundleFrameworkBundle(),
                          new SymfonyBundleSecurityBundleSecurityBundle(),
                          new SymfonyBundleTwigBundleTwigBundle(),
                          new SymfonyBundleMonologBundleMonologBundle(),
                          new SymfonyBundleSwiftmailerBundleSwiftmailerBundle(),
                          new SymfonyBundleDoctrineBundleDoctrineBundle(),
                          new SymfonyBundleAsseticBundleAsseticBundle(),
                          new SensioBundleFrameworkExtraBundleSensioFrameworkExtraBundle(),
                          new JMSSecurityExtraBundleJMSSecurityExtraBundle(),
                  +       new AcmeDemoBundleAcmeDemoBundle()
                      }
                  
                  if (in_array($this->getEnvironment(), array('dev', 'test'))) {
                  -       $bundles[] = new AcmeDemoBundleAcmeDemoBundle();
                          $bundles[] = new SymfonyBundleWebProfilerBundleWebProfilerBundle();
                          $bundles[] = new SensioBundleDistributionBundleSensioDistributionBundle();
                          $bundles[] = new SensioBundleGeneratorBundleSensioGeneratorBundle();
                      } 
                  

                  (+ 是您应该添加的行,- 是您应该删除的行)

                  (+ is the line you should add, - is the line you should remove)

                  这篇关于为什么我访问 app.php 时 Symfony2 安装 404ing?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:搜索 Kohana 初学者的 PHP 教程 下一篇:如何在 MySQL 中保留记录更新的历史记录?

                  相关文章

                2. <i id='jHXDD'><tr id='jHXDD'><dt id='jHXDD'><q id='jHXDD'><span id='jHXDD'><b id='jHXDD'><form id='jHXDD'><ins id='jHXDD'></ins><ul id='jHXDD'></ul><sub id='jHXDD'></sub></form><legend id='jHXDD'></legend><bdo id='jHXDD'><pre id='jHXDD'><center id='jHXDD'></center></pre></bdo></b><th id='jHXDD'></th></span></q></dt></tr></i><div id='jHXDD'><tfoot id='jHXDD'></tfoot><dl id='jHXDD'><fieldset id='jHXDD'></fieldset></dl></div>
                3. <tfoot id='jHXDD'></tfoot>
                4. <small id='jHXDD'></small><noframes id='jHXDD'>

                    <legend id='jHXDD'><style id='jHXDD'><dir id='jHXDD'><q id='jHXDD'></q></dir></style></legend>

                    • <bdo id='jHXDD'></bdo><ul id='jHXDD'></ul>