I'm new to Symfony and I'm trying to make a simple web page, afterinstalling docker, php 8.3 and composer, I downloaded a Symfony image (v5.4.20) and added doctrine to it
Now, both the database and php image work and are running, so I made a controller and added a rote to it:
My routes.yaml file:
controllers:
resource:
path: ../src/Controller/
namespace: App\Controller
type: attribute
My controller:
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class HomeController extends AbstractController
{
#[Route('/', name: "home_slashed")]
#[Route('/home', name: "home")]
public function index(): Response
{
return $this->render("home/index.html.twig");
}
}
and if I run php .\bin\console debug:router it shows:
-------------- -------- -------- ------ -------
Name Method Scheme Host Path
-------------- -------- -------- ------ -------
home_slashed ANY ANY ANY /
home ANY ANY ANY /home
-------------- -------- -------- ------ -------
BUT none of this show anything, every page that I try to load just show me a php_info page!
localhost , localhost/home or localhost/anything is the same...
I tried to change the routes, or generate any kind of error but it always show the phph_info page, even when I introduce a syntax error in the controller
what I'm missing?
public/index.php