PHPackages                             rudderstack/rudder-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rudderstack/rudder-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rudderstack/rudder-php-sdk
==========================

RudderStack Analytics SDK PHP library

2.1.1(2mo ago)81.6M↓51.7%1[1 issues](https://github.com/rudderlabs/rudder-php-sdk/issues)[12 PRs](https://github.com/rudderlabs/rudder-php-sdk/pulls)1MITPHPPHP ^7.4 || ^8.0

Since Mar 26Pushed 1w ago7 watchersCompare

[ Source](https://github.com/rudderlabs/rudder-php-sdk)[ Packagist](https://packagist.org/packages/rudderstack/rudder-php-sdk)[ Docs](https://rudderstack.com/)[ RSS](/packages/rudderstack-rudder-php-sdk/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (20)Versions (26)Used By (1)

What is RudderStack?
====================

[](#what-is-rudderstack)

[![Ask DeepWiki](https://camo.githubusercontent.com/0f5ae213ac378635adeb5d7f13cef055ad2f7d9a47b36de7b1c67dbe09f609ca/68747470733a2f2f6465657077696b692e636f6d2f62616467652e737667)](https://deepwiki.com/rudderlabs/rudder-php-sdk)

[RudderStack](https://rudderstack.com/) is a **customer data pipeline** tool for collecting, routing and processing data from your websites, apps, cloud tools, and data warehouse.

More information on RudderStack can be found [here](https://github.com/rudderlabs/rudder-server).

Getting Started with PHP SDK
----------------------------

[](#getting-started-with-php-sdk)

Install `rudder-php-sdk` using `composer`

```
git clone https://github.com/rudderlabs/rudder-php-sdk /my/app/folders/

```

Initialize the `Client`
-----------------------

[](#initialize-the-client)

```
use Rudder\Rudder;

require_once realpath(__DIR__ . '/vendor/autoload.php');

Rudder::init(WRITE_KEY, array(
  "data_plane_url" => DATA_PLANE_URL,
  "consumer"       => "lib_curl",
  "debug"          => true,
  "max_queue_size" => 10000,
  "flush_at"     => 100
));

```

SDK Initialization options
--------------------------

[](#sdk-initialization-options)

Below parameters are optional and can be passed during SDK initialization.

NameTypeDefault valueDescription`consumer`String`lib_curl`To explicitly mark which consumer to use.`data_plane_url`String`hosted.rudderlabs.com`The data plane URL.`debug`Boolean`false`Whether to log messages and wait for a response. Makes any queuing consumers non-async, defaults to false. This will make the library block until a response has been received from the API, so it is not recommended for production use.`ssl`Boolean`true`Whether to use SSL for the connection.`tls`String`false`Whether to use TLS instead of SSL for the socket connection.`error_handler`Function`function ($code, $message) {}`A handler which will be called on errors to aid in debugging. A function to handle errors, particularly useful for debugging. Note that if debug mode is not specified, then the error\_handler will only be called on connection level errors and timeouts.`max_queue_size`Number`10000`The max number of items in the queue .`flush_at`Number`100`How many items to send in a single curl request .`timeout`Number`0.5`The number of seconds to wait for the socket request to time out .`filename`String`/tmp/analytics.log`The location to write the log file when file consumer is selected.`compress_request`Boolean`true`Whether to use gzipped request payloads. This is supported for server versions 1.4.0 and above.`flush_inteval`Number`10000`Frequency in milliseconds to send data using flush method execution.`curl_timeout`Number`0 (infinite)`Set timeout for the curl connections.`curl_connecttimeout`Number`300`Set connect timeout for the curl connections.`max_item_size_bytes`Number`32000`Set maximum message item size in bytes.`max_queue_size_bytes`Number`512000`Set maximum batch size in bytes.`filepermissions`Number`0644`Set the file permissions for file consumer.Send Events
-----------

[](#send-events)

```
Rudder::track(array(
  "userId" => "f4ca124298",
  "event" => "Signed Up",
  "properties" => array(
    "plan" => "Enterprise"
  )
));

```

Acknowledgements
----------------

[](#acknowledgements)

This project is a fork of [analytics-php](https://github.com/segmentio/analytics-php) by \[segmentio\].

Contact Us
----------

[](#contact-us)

If you come across any issues while configuring or using this SDK, feel free to start a conversation on our [Slack](https://resources.rudderstack.com/join-rudderstack-slack) channel. We will be happy to help you.

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance91

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~371 days

Recently: every ~401 days

Total

6

Last Release

67d ago

Major Versions

1.0.1 → 2.0.02023-01-05

PHP version history (2 changes)1.0.0PHP &gt;=5.3.3

2.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52480567?v=4)[RudderStack](/maintainers/rudderlabs)[@rudderlabs](https://github.com/rudderlabs)

---

Top Contributors

[![bardisg](https://avatars.githubusercontent.com/u/109069547?v=4)](https://github.com/bardisg "bardisg (38 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (28 commits)")[![shrouti1507](https://avatars.githubusercontent.com/u/60211312?v=4)](https://github.com/shrouti1507 "shrouti1507 (10 commits)")[![1abhishekpandey](https://avatars.githubusercontent.com/u/64667840?v=4)](https://github.com/1abhishekpandey "1abhishekpandey (8 commits)")[![arnab-p](https://avatars.githubusercontent.com/u/30770913?v=4)](https://github.com/arnab-p "arnab-p (6 commits)")[![Shivam4415](https://avatars.githubusercontent.com/u/25522437?v=4)](https://github.com/Shivam4415 "Shivam4415 (3 commits)")[![aris1009](https://avatars.githubusercontent.com/u/25184469?v=4)](https://github.com/aris1009 "aris1009 (3 commits)")[![dciccale](https://avatars.githubusercontent.com/u/539546?v=4)](https://github.com/dciccale "dciccale (2 commits)")[![stepsecurity-app[bot]](https://avatars.githubusercontent.com/in/1053343?v=4)](https://github.com/stepsecurity-app[bot] "stepsecurity-app[bot] (2 commits)")[![MoumitaM](https://avatars.githubusercontent.com/u/36885121?v=4)](https://github.com/MoumitaM "MoumitaM (2 commits)")[![ishachopra0401](https://avatars.githubusercontent.com/u/97496803?v=4)](https://github.com/ishachopra0401 "ishachopra0401 (2 commits)")[![vgupta98](https://avatars.githubusercontent.com/u/28345515?v=4)](https://github.com/vgupta98 "vgupta98 (1 commits)")[![kayw-geek](https://avatars.githubusercontent.com/u/29700073?v=4)](https://github.com/kayw-geek "kayw-geek (1 commits)")[![lokey](https://avatars.githubusercontent.com/u/411699?v=4)](https://github.com/lokey "lokey (1 commits)")

---

Tags

analyticsrudderrudderstackrudderanalytics.js

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/rudderstack-rudder-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/rudderstack-rudder-php-sdk/health.svg)](https://phpackages.com/packages/rudderstack-rudder-php-sdk)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k78.3k91](/packages/pocketmine-pocketmine-mp)[saithink/saiadmin

webman plugin

28211.5k1](/packages/saithink-saiadmin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
