PHPackages                             kjdev/snappy - 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. kjdev/snappy

ActivePhp-ext

kjdev/snappy
============

A compression/decompression with Snappy

0.2.3(1y ago)14324937[9 issues](https://github.com/kjdev/php-ext-snappy/issues)MITPHPPHP &gt;= 5.2.0CI passing

Since Apr 9Pushed 4mo ago9 watchersCompare

[ Source](https://github.com/kjdev/php-ext-snappy)[ Packagist](https://packagist.org/packages/kjdev/snappy)[ RSS](/packages/kjdev-snappy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Snappy Extension for PHP
========================

[](#snappy-extension-for-php)

[![Linux](https://github.com/kjdev/php-ext-snappy/actions/workflows/linux.yaml/badge.svg?branch=master)](https://github.com/kjdev/php-ext-snappy/actions/workflows/linux.yaml)[![Windows](https://github.com/kjdev/php-ext-snappy/actions/workflows/windows.yaml/badge.svg?branch=master)](https://github.com/kjdev/php-ext-snappy/actions/workflows/windows.yaml)

This extension allows Snappy.

Documentation for Snappy can be found at [» http://google.github.io/snappy/](http://google.github.io/snappy/).

Build from sources
------------------

[](#build-from-sources)

```
git clone --recursive --depth=1 https://github.com/kjdev/php-ext-snappy.git
cd php-ext-snappy
phpize
./configure
make
make install
```

To use the system library

```
./configure --with-snappy-includedir=/usr
```

Distribution binary packages
----------------------------

[](#distribution-binary-packages)

### Fedora / CentOS / RHEL

[](#fedora--centos--rhel)

RPM packages of this extension are available in [» Remi's RPM repository](https://rpms.remirepo.net/) and are named **php-snappy**.

Configuration
-------------

[](#configuration)

php.ini:

```
extension=snappy.so
```

### Function : `snappy_compress()`

[](#function--snappy_compress)

string snappy\_compress( string $data )

#### parameters

[](#parameters)

data:

```
The data to compress.

```

#### return values

[](#return-values)

The compressed string or FALSE if an error occurred.

### Function : `snappy_uncompress()`

[](#function--snappy_uncompress)

string snappy\_uncompress( string $data )

#### parameters

[](#parameters-1)

name:

```
The data compressed by snappy_compress().

```

#### return values

[](#return-values-1)

The original uncompressed data or FALSE on error.

Example
-------

[](#example)

```
$compressed = snappy_compress('Compress me');

$uncompressed = snappy_uncompress($compressed);

echo $uncompressed;
```

Troubleshooting
---------------

[](#troubleshooting)

### Ubuntu / OSX

[](#ubuntu--osx)

Snappy requires C++ and therefore might require for you to install the g++ or build-essential package.

If you get an error about "this file requires compiler and library support" or [compilation errors on OSX](https://github.com/kjdev/php-ext-snappy/issues/19), you need to enforce the compilation with `-std=c++11` flag:

```
export CXXFLAGS=-std=c++11
phpize
./configure
make
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance61

Regular maintenance activity

Popularity33

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.3% of commits — single point of failure

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

Unknown

Total

1

Last Release

405d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18072f3d3a57cc6f8e11a0f405648caf4927261c0fc122f9cfa0d1441e087fb7?d=identicon)[kjdev](/maintainers/kjdev)

---

Top Contributors

[![kjdev](https://avatars.githubusercontent.com/u/465132?v=4)](https://github.com/kjdev "kjdev (91 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (4 commits)")[![andypost](https://avatars.githubusercontent.com/u/73713?v=4)](https://github.com/andypost "andypost (2 commits)")[![Miniwoffer](https://avatars.githubusercontent.com/u/6328564?v=4)](https://github.com/Miniwoffer "Miniwoffer (1 commits)")[![Sean-Der](https://avatars.githubusercontent.com/u/1302304?v=4)](https://github.com/Sean-Der "Sean-Der (1 commits)")[![sergey-dryabzhinsky](https://avatars.githubusercontent.com/u/717597?v=4)](https://github.com/sergey-dryabzhinsky "sergey-dryabzhinsky (1 commits)")[![stloyd](https://avatars.githubusercontent.com/u/67402?v=4)](https://github.com/stloyd "stloyd (1 commits)")[![cwenzelg](https://avatars.githubusercontent.com/u/16069840?v=4)](https://github.com/cwenzelg "cwenzelg (1 commits)")[![drexlma](https://avatars.githubusercontent.com/u/7121202?v=4)](https://github.com/drexlma "drexlma (1 commits)")

### Embed Badge

![Health badge](/badges/kjdev-snappy/health.svg)

```
[![Health](https://phpackages.com/badges/kjdev-snappy/health.svg)](https://phpackages.com/packages/kjdev-snappy)
```

PHPackages © 2026

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