-3

I've taken a picture of the above error. I don't understand this error and I definitely don't understand how to fix it either.

I am using PhpStorm with Symfony. I want to be able to connect to the database. I have set up my entities and my controllers.

The error is mainly coming from classes.php and it is still there even when I tried creating a new project with Symfony. I've looked at the line but I don't see error messages.

See the image error:

enter image description here

Has anyone an idea about what this means and what is the best way to fix it ?

LazyOne
  • 158,824
  • 45
  • 388
  • 391

2 Answers2

4

It means that somewhere you have defined a 'Method Requirement' for that route and it doesn't allow 'GET' requests. If you're using annotations, that would look like this:

/**
 * @Route("/")
 * @Method("POST")
 */
public function indexAction()
{
    // ... display your page
}

If you're routing with YAML, it will look like this:

home:
    path:     /
    defaults: { _controller: AppBundle:Main:index }
    methods:  [POST]

You need to either get rid of the method requirement, or add 'GET' to it.

HERE are the docs

Ragdata
  • 1,156
  • 7
  • 16
0

Try, cleaning your cache:

console cache:clear --env=prod
console cache:clear --env=dev

To Verify routes on symfony:

console router:debug