symfonysymfony-flexsymfony4

Can't install profiler symfony flex


I'm unable to use the symfony profiler after running composer req profiler I'm using symfony/skeleton in version 4.0 beta, but i remember having the same problem when i tested it a few months ago in 3.3.

The toolbar isn't working, message here :

An error occurred while loading the web debug toolbar. Open the web profiler.

And when click on "open the web profiler", i have a 404 error.

If someone resolved it, thank you for your help. If not, I'll report a bug while this is still in bêta.

About installation : created a project with composer, with the symfony/skeleton package in version 4.0-beta linked here : https://github.com/symfony/skeleton

My php version is 7.1 ; i try to install profiler from the command above.


Solution

  • Try following these steps:

    composer create-project -s beta symfony/skeleton:4.0.x s40b1
    cd s40b1
    composer require web-server
    composer require cli
    composer require profiler
    

    Add a controller

    class DemoController extends AbstractController
    {
        public function demoAction()
        {
            $html = <<<EOT
    <!DOCTYPE html>
    <html>
      <head><meta charset="UTF-8"><title>s4b1</title></head>
      <body>Demo Body</body>
    </html>
    EOT;
            return new Response($html);
        }
    }
    

    And a route

    demo:
        path: /demo
        defaults: { _controller: 'App\Controller\DemoController::demoAction' }
    

    Then

    bin/console cache:clear
    bin/console server:run
    

    Navigate to

    http://127.0.0.1:8000/demo
    

    If it works then determine where your config is different.