Set Up OpenTelemetry PHP Distro
Learn how to install and configure OpenTelemetry PHP Distro to start sending telemetry data from your PHP application.
Learn how to instrument your PHP application with OpenTelemetry PHP Distro and send telemetry data to an OTLP-compatible backend.
Prerequisites
- Have a destination for telemetry data (OTLP endpoint).
- Use a supported Linux distribution and PHP version.
- Do not run another PHP APM or OpenTelemetry agent in the same process.
For supported operating systems and PHP versions, see Supported technologies.
Limitations
Known runtime and compatibility limitations are described in Limitations.
Download and install packages
Download a package for your platform from the GitHub Releases page and install it.
RPM (RHEL/CentOS/Fedora)
sudo rpm -ivh <package-file>.rpm
DEB (Debian/Ubuntu)
sudo dpkg -i <package-file>.deb
APK (Alpine)
sudo apk add --allow-untrusted <package-file>.apk
Configure exporter
At a minimum, set:
OTEL_EXPORTER_OTLP_ENDPOINTOTEL_EXPORTER_OTLP_HEADERS
Example:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://your-otlp-endpoint:443/"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <token>"
Restart PHP processes
After installation and configuration, restart PHP processes (for example
php-fpm, Apache workers, or long-running CLI workers) so the extension loads.
Confirm telemetry
- Open your observability backend.
- Find your service in traces.
- Generate traffic if no traces are visible yet.
Troubleshooting
- Verify configuration options in Configuration.
- Check known constraints in Limitations.
- If using Laravel Octane (Swoole or RoadRunner), see Long-running PHP servers.
Feedback
Was this page helpful?
Thank you. Your feedback is appreciated!
Please let us know how we can improve this page. Your feedback is appreciated!