PHPackages                             wpjscc/php-json-rpc - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. wpjscc/php-json-rpc

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

wpjscc/php-json-rpc
===================

A maintained fork of the datto/json-rpc package. Fully unit-tested JSON-RPC 2.0 for PHP.

7.0.1(6mo ago)0211LGPL-3.0-or-laterPHPPHP ^7.4 || ^8.0

Since Nov 1Pushed 6mo agoCompare

[ Source](https://github.com/wpjscc/php-json-rpc)[ Packagist](https://packagist.org/packages/wpjscc/php-json-rpc)[ Docs](https://www.hawkinscomputerservices.com/)[ RSS](/packages/wpjscc-php-json-rpc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (1)

JSON-RPC for PHP
================

[](#json-rpc-for-php)

> **Note:** This is a maintained fork of the original [datto/json-rpc](https://github.com/datto/php-json-rpc) package, which has been abandoned. This repository will be kept up-to-date with bug fixes and new features.

Overview
--------

[](#overview)

This package allows you to create and evaluate JSON-RPC messages, using your own PHP code to evaluate the requests.

This package allows you to create and evaluate any JSON-RPC message. It implements the JSON-RPC specifications, but does *not* provide a transport layer—which you'll also need if you want to send or receive messages over a distance! One of the beautiful features of JSON-RPC is that you can use *any*transport layer to carry your messages: This package gives you that option.

If you're looking for an end-to-end solution, with the transport layer included, then you should use one of these alternative packages instead:

- To send messages over HTTP(S), use the [php-json-rpc-http](https://github.com/hcs-llc/php-json-rpc-http) package.
- To send messages over SSH, use the [php-json-rpc-ssh](https://github.com/hcs-llc/php-json-rpc-ssh) package.

Features
--------

[](#features)

- Correct: fully compliant with the [JSON-RPC 2.0 specifications](http://www.jsonrpc.org/specification) (100% unit-test coverage)
- Flexible: you can use your own code to evaluate the JSON-RPC method strings
- Minimalistic: extremely lightweight
- Ready to use, with working examples

Examples
--------

[](#examples)

### Client

[](#client)

```
$client = new Client();

$client->query(1, 'add', array(1, 2));

$message = $client->encode();

// message: {"jsonrpc":"2.0","method":"add","params":[1,2],"id":1}
```

### Server

[](#server)

```
$api = new Api();

$server = new Server($api);

$reply = $server->reply($message);

// reply: {"jsonrpc":"2.0","result":3,"id":1}
```

*See the [examples](https://github.com/hcs-llc/php-json-rpc/tree/master/examples) folder for full working examples.*

Requirements
------------

[](#requirements)

- PHP &gt;= 7.0

License
-------

[](#license)

This package is released under an open-source license: [LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.html)

Installation
------------

[](#installation)

If you're using [Composer](https://getcomposer.org/), you can include this library ([hcs-llc/php-json-rpc](https://packagist.org/packages/hcs-llc/php-json-rpc)) like this:

```
composer require "hcs-llc/php-json-rpc"

```

Getting started
---------------

[](#getting-started)

1. Try the examples. You can run the examples from the project directory like this:

    ```
    php examples/client.php
    php examples/server.php

    ```
2. Take a look at the code "examples/src"—then replace it with your own!

Unit tests
----------

[](#unit-tests)

You can run the suite of unit tests from the project directory like this:

```
./vendor/bin/phpunit

```

Changelog
---------

[](#changelog)

See what has changed: [Changelog](https://github.com/hcs-llc/php-json-rpc/blob/master/CHANGELOG.md)

Original Author
---------------

[](#original-author)

[Spencer Mortensen](http://spencermortensen.com/contact/)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance66

Regular maintenance activity

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

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

199d ago

### Community

Maintainers

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

---

Top Contributors

[![smortensen](https://avatars.githubusercontent.com/u/2285119?v=4)](https://github.com/smortensen "smortensen (34 commits)")[![RLHawk1](https://avatars.githubusercontent.com/u/1224305?v=4)](https://github.com/RLHawk1 "RLHawk1 (6 commits)")[![wpjscc](https://avatars.githubusercontent.com/u/76907477?v=4)](https://github.com/wpjscc "wpjscc (2 commits)")[![shawnrc](https://avatars.githubusercontent.com/u/5643442?v=4)](https://github.com/shawnrc "shawnrc (1 commits)")

---

Tags

phpjsonrpcjsonrpcjson-rpcphp-json-rpc

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wpjscc-php-json-rpc/health.svg)

```
[![Health](https://phpackages.com/badges/wpjscc-php-json-rpc/health.svg)](https://phpackages.com/packages/wpjscc-php-json-rpc)
```

###  Alternatives

[datto/json-rpc

Fully unit-tested JSON-RPC 2.0 for PHP

1951.3M14](/packages/datto-json-rpc)[datto/json-rpc-http

HTTP client and server for JSON-RPC 2.0

66525.9k5](/packages/datto-json-rpc-http)[wa72/jsonrpc-bundle

JSON-RPC server for Symfony: exposes services registered in the service container as JSON-RPC webservices

3164.1k](/packages/wa72-jsonrpc-bundle)[cranetm/yii2-json-rpc-2.0

JSON RPC 2.0 for Yii2 strict type validation of request and response data

2679.6k1](/packages/cranetm-yii2-json-rpc-20)[nizsheanez/yii2-json-rpc

A lightweight JsonRpc Server and Client for PHP

2034.0k](/packages/nizsheanez-yii2-json-rpc)[tinywan/rpc

simple rpc service for webman plugin

193.5k](/packages/tinywan-rpc)

PHPackages © 2026

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