Repository navigation
Global Install
The global install makes peep() available to every script a PHP install runs, with no Composer and no code changes: legacy apps, WordPress, one-off scripts.
It is a PHAR loaded through PHP's auto_prepend_file. Install it for each PHP version you use (Peep supports 7.1 to 8.5).
Download peep.phar from the releases page, then:
php peep.phar installThis copies the PHAR to ~/.peep/peep.phar and writes 99-peep.ini into PHP's ini scan directory. Check the result with:
php ~/.peep/peep.phar statusRestart PHP-FPM (or Herd, Valet, Apache) so web requests pick up the change.
Options:
| Option | Does |
|---|---|
--dry-run |
Shows what would change, changes nothing |
--ini-dir=DIR |
Writes the ini file into DIR instead of the scan directory |
--force |
Replaces an auto_prepend_file that something else set |
Writing into a system directory such as /etc/php/8.3/cli/conf.d may need sudo. If the PHP has no scan directory, install prints the line to add to php.ini yourself.
PHP allows one auto_prepend_file. Laravel Herd, for example, uses it for its own dump capture, so install stops instead of replacing it. Use --force only if you no longer need the other one, or install Peep with Composer for those projects.
A script loaded through the global install has Peep on unless something says otherwise, because installing it globally is already the opt-in. Turn it off:
- for one project, with a
peep.phpfile returning['enabled' => false]; - for one run, with
PEEP_ENABLED=false.
When the viewer is not running, each script pays a few milliseconds once and then skips Peep.
A project that requires shibbirweb/peep uses its own version, not the PHAR. The PHAR registers its autoloader last, so Composer's autoloader loads Peep's classes first.
flowchart LR
Script["Any PHP script"] --> Prepend["auto_prepend_file:<br/>peep.phar"]
Prepend --> Fn["peep() is defined"]
Script --> Composer{"Does the project<br/>require shibbirweb/peep?"}
Composer -- yes --> Own["Composer's autoloader<br/>(registered first) loads its version"]
Composer -- no --> Phar["The PHAR's autoloader<br/>loads Peep from the PHAR"]
Mount the PHAR into the container and load it there:
docker run --rm \
--add-host=host.docker.internal:host-gateway \
-e PEEP_HOST=host.docker.internal \
-v ~/.peep:/peep \
php:8.3-cli php -d auto_prepend_file=/peep/peep.phar script.phpphp ~/.peep/peep.phar uninstallIt removes the ini file only if Peep wrote it, and deletes ~/.peep/peep.phar.
This wiki is written in docs/wiki; change it there by pull request.
Using Peep
- Getting Started
- Installation
- Version Support
- Configuration
- The Viewer
- API Reference
- API Values
- API Inspecting
- API Control
- API Laravel
- Laravel
- Query Debugging
- Plain PHP
- Symfony
- Slim
- WordPress
- Global Install
- Mail and SMS
- Webhooks
- Logs
- Desktop App
- Finding Leftover Calls
- AI Agents
- Troubleshooting
Working on Peep