Symfony2: access the same route during development as development

I am developing a small application using Symfony2. I can access all routes without problems in my dev environment:

http: //symfony/app_dev.php/cp ("symfony" is in my hosts file for localhost permission)

However, as soon as I try to access it in a production environment, I just get a 404 error page:

http: //symfony/app.php/cp

Oops! An error has occurred. The server returned "404 Not Found." Something broke. Send us an email and let us know what you did when this error occurred. We will fix it as soon as possible. Sorry for the inconvenience.

Is there something I need to change / do before I can view my application in production? I did not mess up any of the main files (kernel / bootstrap / app files, etc.). I am using Release Candidate 3.

+8
symfony production-environment production dev-to-production
source share
1 answer

As Krozin already mentioned in his comment, you need to rebuild the cache to see your changes. You need to rebuild the production cache every time you change something in the configuration, routing, or patterns. The safest way to do this is to use php app/console cache:clear --env=prod --no-debug (since the CLI works in dev mode with debugging turned on by default).

+16
source share

All Articles