Reputation: 373
I am trying to begin my education of symfony 2 and started with it's tutorial. One of first things I tried was to install symfony 2 and configure it.
When I try to access http://127.0.0.1:8000/, I am getting an incomplete site with the following error:
ERROR - Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /"" at /home/spectator/webprojects/cls/app/cache/dev/classes.php line 2059
Things I have tried so far:
php app/console cache:clear --env=prod --no-debug
) 775
and even 777
(for diagnostics purposes) Upvotes: 1
Views: 14221
Reputation: 1
I had the same problem. Just add <?php
in the top of the file. Looks like if we don't specify it s
Upvotes: -1
Reputation: 4107
In the past, a fresh Symfony installation also included some simple demo code to learn how does the framework work. A few months ago we decided to change this behavior by the following:
If you use the Symfony Installer, you should do the following:
symfony demo
commandsymfony new my_project
commandUpvotes: 0
Reputation: 36
Try http://localhost:8000/app/example
Fresh installation has no routes for the root path "/"
Upvotes: 2
Reputation: 5084
The default installation does not come with a default route for "/".
The example controller only defines a route of
@Route("/app/example", name="homepage")
Upvotes: 0
Reputation: 36
first you need to set a default route edit the routing.yml app/config/routing.yml
app:
resource: @AppBundle/Controller/ # bundle name / Controller name
type: annotation # type of routing or
# app/config/routing.yml # file routing
app:
resource: @AppBundle/Controller/
prefix: /
you can learn more in http://symfony.com/doc/current/book/routing.html
Upvotes: 0