zip-fa/posthog-php

PostHog PHP Library
2,398
Install
composer require zip-fa/posthog-php
PHP:>=8.2
License:MIT
Last Updated:May 30, 2026
Links: GitHub  ·  Packagist
Maintainer: zip-fa

PostHog PHP

PHP Version CI

Please see the main PostHog docs.

Specifically, the PHP integration details.

Features

  • ✅ Event capture and user identification
  • ✅ Feature flags, including local evaluation, multivariate flags, payloads, and flag dependencies
  • ✅ Group analytics
  • ✅ Error tracking with manual exception capture and opt-in automatic PHP exception, error, and fatal shutdown capture
  • ✅ Request context helpers for applying distinct IDs, session IDs, and common properties across a request
  • ✅ Comprehensive test coverage

Questions?

Join our Slack community.

Contributing

See CONTRIBUTING.md for local setup and test instructions.

Releasing

See RELEASING.md.