Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Xhprof Bundle

Xhprof Bundle Laravel Package

aferrandini/xhprof-bundle

Laravel-friendly integration of XHProf profiling: collect and view performance data for your app, track request timings and call graphs, and store runs for comparison. Useful for spotting bottlenecks in production-like environments.

View on GitHub
Deep Wiki
Context7

XhprofBundle

Frequently asked questions about Xhprof Bundle
Can I use this bundle directly in Laravel since it’s a Symfony package?
No, this bundle is designed for Symfony and won’t work out-of-the-box in Laravel due to differences in dependency injection. You’d need to manually integrate the underlying XHProf extension (pecl/xhprof) via middleware, service providers, and custom storage logic. The bundle’s Symfony-specific features won’t transfer.
What PHP versions does this package support, and will it work with Laravel’s latest stack?
The package was last updated in 2014 and officially supports PHP 5.3–7.0. For PHP 7.4+, you’d need a patched version of XHProf (e.g., xhprof-hhvm forks) or a community-maintained fork. Laravel’s modern stack (PHP 8.x) may require significant refactoring or alternative tools like Blackfire.
How do I manually integrate XHProf into Laravel for profiling?
Install the pecl/xhprof extension (`pecl install xhprof`), enable it in php.ini, then create a Laravel service provider to initialize XHProf (e.g., `XHProf::enable()`). Use middleware to start/stop profiling per request and store runs in files or a database. The XHProf UI can then visualize call graphs and timings via `xhprof_lib/utils/xhprof_lib.php`.
Is this bundle still maintained, or should I look for alternatives?
This bundle is abandoned (last release 2014) with no updates for Symfony 5/6 or Laravel. For active maintenance, consider alternatives like Laravel Debugbar, Blackfire, or Tideways, which offer better PHP 8.x support, lower overhead, and Laravel-native integrations. A fork might work but requires effort.
What kind of performance bottlenecks can XHProf help me find in Laravel?
XHProf excels at identifying CPU/memory-heavy functions, slow database queries, or external API calls by providing granular call graphs and timing data. It’s useful for debugging slow endpoints, recursive loops, or inefficient service containers—though modern tools like Blackfire offer similar features with better Laravel integration.
How do I store and analyze XHProf profiling runs in Laravel?
You’ll need custom logic to save runs (e.g., `xhprof_disable()` + file/database storage) and process them for visualization. The XHProf UI (`xhprof_lib/utils/xhprof_lib.php`) can generate reports, but integrating with tools like Grafana or QCacheGrind may require additional scripting. Storage is manual; no built-in Laravel support exists.
Will this bundle add significant overhead to my Laravel app in production?
Yes, XHProf adds ~3–5% overhead due to function-level tracing. For production, disable profiling via environment checks (e.g., `app()->environment('local')`). Modern tools like Blackfire or Tideways offer lower latency and production-safe profiling with minimal impact.
Are there Laravel-specific alternatives to this bundle for profiling?
Yes, consider Laravel Debugbar (for basic profiling), Blackfire (enterprise-grade, low overhead), or Tideways (production-safe). These tools are actively maintained, Laravel-compatible, and offer better PHP 8.x support. If you need XHProf’s granularity, a manual integration (as described above) is an option but less polished.
Can I use this bundle alongside Laravel Debugbar or other profiling tools?
No, XHProf and Laravel Debugbar (or similar tools) may conflict due to overlapping functionality or middleware hooks. If you need multiple profilers, disable XHProf in production or use middleware guards to prevent concurrent profiling. Alternatives like Blackfire avoid such conflicts entirely.
How do I check if XHProf is compatible with my Laravel project’s PHP version?
Run `php -m | grep xhprof` to verify the extension is installed. Test with a simple script using `xhprof_enable()`/`xhprof_disable()` to confirm functionality. For PHP 8.x, check community forks (e.g., xhprof-hhvm) or test with a patched version. Laravel’s PHP version must match XHProf’s supported range (up to PHP 7.0 natively).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui