Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /"

$
0
0

I just started following a symfony 4 tutorialI set up the whole project with composer and got the index file showing up in browser http://127.0.0.1:8000/

I'm stuck on the very first Router/Controller/View exampleThe route is not working properly or at all. I always get a 404 error.

1:

enter image description here

2:

enter image description here

3:

enter image description here

<?phpnamespace App\Controller;use Symfony\Component\HttpFoundation\Response;class LuckyController{    public function number()    {        $number = random_int(0, 100);        return new Response('<html><body>Lucky number: '.$number.'</body></html>'        );    }}
# the "app_lucky_number" route name is not important yetapp_lucky_number:  path: /lucky/number  controller: App\Controller\LuckyController::number

I'm out of ideas, I've looked everywhere on google and did not found a solution.


Viewing all articles
Browse latest Browse all 3924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>