PHPackages                             protocolbuffers/protoc-gen-php - 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. protocolbuffers/protoc-gen-php

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

protocolbuffers/protoc-gen-php
==============================

protoc generator plugin for PECL ProtocolBuffers

0.1.0(12y ago)529.1k22[8 issues](https://github.com/chobie/protoc-gen-php/issues)[1 PRs](https://github.com/chobie/protoc-gen-php/pulls)BSD-2-ClausePHPPHP &gt;=5.3.3CI failing

Since Feb 11Pushed 11y ago5 watchersCompare

[ Source](https://github.com/chobie/protoc-gen-php)[ Packagist](https://packagist.org/packages/protocolbuffers/protoc-gen-php)[ Docs](https://github.com/chobie/protoc-gen-php)[ RSS](/packages/protocolbuffers-protoc-gen-php/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

protoc-gen-php
==============

[](#protoc-gen-php)

protoc php generator plugin .

[![Build Status](https://camo.githubusercontent.com/374946cfa78df9a0d24f010a9b74964902cf181dde35d9871505fc84dbe3cf99/68747470733a2f2f7472617669732d63692e6f72672f63686f6269652f70726f746f632d67656e2d7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/chobie/protoc-gen-php)

Installation
============

[](#installation)

you can install protoc-gen-php with composer command.

```
# add protocolbuffers/protoc-gen-php entry to your global composer.json ($HOME/.composer/composer.json)
{
    "require": {
        "protocolbuffers/protoc-gen-php": "dev-master"
    }
}

# install with composer
composer global install
# set PATH (add this line to your .bashrc or .zshrc.)
export PATH=$HOME/.composer/vendor/bin/:$PATH

```

Usage
=====

[](#usage)

```
# this will link composer/bin/protoc-gen-php to /usr/local/bin/protoc-gen-php
protoc --php_out= -I. person.proto

# you can also specify the command.
protoc --plugin=vendor/bin/protoc-gen-php --php_out= -I. person.proto

```

Features
--------

[](#features)

### Yaml based insertion

[](#yaml-based-insertion)

protoc has comment based `insertion point` mechanism. it's very usefull to customize generated message. but you need to write custom plugin when using that. protoc-gen-php has pragmatic feature which will check `.protoc.php.yml` and insert contents when matched.

see

### Environments

[](#environments)

you can override protoc-gen-php behavior with environemnts.

keydescriptionexamplePACKAGEover ride package name. expects dot delimited package namePACKAGE=chobie.ioPEAR\_STYLEdon't use namespace.PEAR\_STYLE=1requirements
------------

[](#requirements)

- [php-protocolbuffers](https://github.com/chobie/php-protocolbuffers)

License
-------

[](#license)

new BSD License

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.2% 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

4478d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/195038?v=4)[Shuhei Tanuma](/maintainers/chobie)[@chobie](https://github.com/chobie)

---

Top Contributors

[![chobie](https://avatars.githubusercontent.com/u/195038?v=4)](https://github.com/chobie "chobie (60 commits)")[![ossinkine](https://avatars.githubusercontent.com/u/2588533?v=4)](https://github.com/ossinkine "ossinkine (2 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")

---

Tags

protocol buffersprotoc

### Embed Badge

![Health badge](/badges/protocolbuffers-protoc-gen-php/health.svg)

```
[![Health](https://phpackages.com/badges/protocolbuffers-protoc-gen-php/health.svg)](https://phpackages.com/packages/protocolbuffers-protoc-gen-php)
```

###  Alternatives

[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[liues1992/php-protobuf-generator

Google's protobuf generator for PHP

1112.6k2](/packages/liues1992-php-protobuf-generator)

PHPackages © 2026

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