Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8812249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:33:46+00:00 2026-06-14T03:33:46+00:00

I have installed Symfony2, after fixing the file permissions, I can access the dev

  • 0

I have installed Symfony2, after fixing the file permissions, I can access the dev environment from my browser by pointing it to:

http://localhost/app_dev.php

However, when I try to access the production environment by pointing the browser to http://localhost, I get the following exception (from app/logs/prod.log):

[2012-08-13 11:30:03] request.ERROR:
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route
found for “GET /” (uncaught exc eption) at
/path/to/frameworks/Symfony2/app/cache/prod/classes.php line 4584 []
[]

I then checked the available routes for the prod environment from the command line. here is the result of that investigation.

root@yourbox:~/path/to/frameworks/Symfony2$ php app/console
router:debug -e=prod [router] Current routes Name Method Pattern

Incredibly, it shows that there are no routes defined for this environment (I didn’t believe the error message – which essentially said the same thing).

So, my conclusion is this: out of the box installation of Symfony2, and the production environment has no default routes – is this true, or have I made a mistake somewhere?

More importantly, how do I fix this?. In SF1.x, it was straight forward to switch from dev to prod and vice versa. How do I view the AcmeDemo app for example, in a prod environment. ?

[[UPDATE]]

After feedback from thecatontheflat, I added a simple test route to my routing.yml file. The contents of app/config/routing.yml are now:

_welcome2:
    pattern:  /test
    defaults: { _controller: AcmeDemoBundle:Welcome:index }

When I try http://localhost/test in the browser, I get the same 404 error. When I debug the routes available at the console, I get the following output:

root@yourbox:~/path/to/frameworks/Symfony2$ php app/console router:debug -e=prod
[router] Current routes
Name      Method Pattern
_welcome2 ANY    /test
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:33:47+00:00Added an answer on June 14, 2026 at 3:33 am

    I had the exact same problem!!

    Symfony2 has two generic routing files called:

    app/config/routing.yml and app/config/routing_dev.yml
    

    However, it also has a bundle specific routing file in each bundle. The standard procedure is to define all of your bundle routes in your bundle routing.yml file then reference this from the main routing.yml file by adding:

    YourbundlenameMainBundle:
    
    resource: "@YourbundlenameMainBundle/Resources/config/routing.yml"
    
    prefix:   /
    

    This is what I had and I was still getting the error. But then I read the error more closely… no route found for GET / …. then I checked my routing_dev.yml file and of course it had a route for / from the Acme demo bundle _welcome route. This is why it works for the dev version but not the prod version!

    Solution:

    Add a route for / to either your routing.yml global file or your routing.yml bundle file by adding the following:

    _welcome:
    
    pattern:  /
    
    defaults: { _controller: YourbundlenameMainBundle:Default:index }
    

    you can change index to some other route if your welcome page is not index

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to setup Symfony2 on Windows so that I can use
I have installed the HerzultFourmBundle into my Symfony2 application, added the calls in the
I have downloaded and installed the Symfony2 standard edition. I've done all the steps
I have installed Lampp on my linux system, and I am learning symfony2, while
In a nutshell I'm writing a Symfony2 / Doctrine2 app and have installed and
I'm following the directions here: http://symfony.com/doc/2.0/bundles/DoctrineMongoDBBundle/index.html I have installed deps: #deps [doctrine-mongodb] git=http://github.com/doctrine/mongodb.git [doctrine-mongodb-odm]
I have Windows 7 and WAMP localhost on drive D: . I installed Symfony2
I am new to symfony2 and and now i have installed Sonata Admin bundle.
I have installed the acts_as_versioned plugin from github.com in my rails application, and there
I have a very basic Symfony2.1 setup with FOSUserBundle installed. When registering all is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.