View profiler data outside the instance you recorded it.
Normally use the app ProfilerViewer instead, which uses this bundle. Use the bundle directly in complex cases.
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Open a command console, enter your project directory and execute:
$ composer require simon-heimberg/profiler-viewer-bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require simon-heimberg/profiler-viewer-bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
// config/bundles.php
return [
// ...
SimonHeimberg\ProfilerViewerBundle\ProfilerViewerBundle::class => ['dev' => true],
];
To give access to routing information, import routing into
app/config/routing.yml
:
config/routing/dev/profiler-viewer.yaml
# config/routing/dev/profiler-viewer.yaml
_profiler_viewer:
resource: "@ProfilerViewerBundle/Resources/config/routing/all.yaml"
prefix: /pview # can be adapted when required
Step 2 (optional): Enable overwrite files for templates (to indicate when you are in the profiler-viewer)
$ mkdir -p templates/bundles/
$ ln -sr vendor/simon_heimberg/profiler_viewer_bundle/Resources/views/overwrite/WebProfilerBundle templates/bundles/
Profiler information may contain sensitive information. So protect the data by
protecting the access to the app or by configureing the firewall for all routes
starting with /pview
.
Set PROFILER_VIEWER_PROFILER_PATH in .env.local (or as real environment
variable) to the profiler path you want to see data from.
Example: PROFILER_VIEWER_PROFILER_PATH=/mendia/from_your_system/project/var/cache/prod/profiler/
Enable dev mode (APP_ENV=dev
) because the symfony profiler warns when used in prod mode.
Navigate to the page http://your-app-base-url/pview/. Use the profiler as usual
- router panel is not shown because it would show current router data