2

I have trouble with Symfony od my new server - if I want to run Demo application, have error message in log:

request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /"" at /var/www/test/app/cache/prod/classes.php line 1881 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException: No route found for \"GET /\" at /var/www/test/app/cache/prod/classes.php:1881, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException:  at /var/www/test/app/cache/prod/appProdUrlMatcher.php:30)"} []

But when I try run local server, application on 127.0.0.1:8000 functions normally.

My config file for Apache VirtualHost is:

<VirtualHost *:80>
    ServerName www.domain.cz
    ServerAlias domain.cz

    DocumentRoot /var/www/test/web

    <Directory /var/www/test/web>
            AllowOverride All
            Order allow,deny
            Allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Can you help me with this issue?

3
  • 1
    You need to write a route for the / path. If you're trying to run the AcmeDemoBundle, make sure you've followed all the steps for installation (such as running composer install and php app/console cache:clear --env=prod. Try accessing the demo bundle from app_dev.php instead Commented Oct 1, 2014 at 14:45
  • 1
    In production, you need to add DirectoryIndex app.php for the routing component to work. I didn't see that instruction on your vhost. Commented Oct 1, 2014 at 14:55
  • Route is wrote correctly. I tried all advice and no progress. Commented Oct 1, 2014 at 15:01

2 Answers 2

1

I think it comes from the routing. Have you declared a route in your bundles resource routing which has pattern / like this

bundle_homepage:
    pattern: /
    defaults: {_controller:Bundlename:Entityname:controllername}
Sign up to request clarification or add additional context in comments.

3 Comments

Route is wrote correctly. On local server it is working correctly.
Do you have your mod_rewrite turned on in .htaccess? Have you cleared the dev/prod cache?
I have not .htaccess files. When I add RewriteEngine On to VirtualHost config file, nothing was changed
0

Problem was in demo - it is not possible to deploy to production environment.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.