Symfony 网页配置文件 404

Symfony4 webprofiler 404

我刚刚建立了一个新的 Symfony 4 项目,但是当我导航到 "public" 文件夹时,webprofiler 显示以下消息:

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

当我点击 "Open the web profiler" 时,出现以下错误:

Error 404, Object not found

本例找不到的路径是:

http://localhost/test-project/public/_profiler/4d2f65

谁能帮我解决这个问题?

用服务器测试。

php -S localhost:8000 -t public/

之后导航至:

http://localhost:8000/_profiler

如果您要从头开始设置 Symfony4/Flex 应用,它可能没有安装探查器。

composer require profiler --dev

您可能还需要按照 webserver-config 在 Apache 或 Nginx 中启用 mod_rewrite。