PHPackages                             laxamar/gpiosysv - 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. laxamar/gpiosysv

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

laxamar/gpiosysv
================

A library for accessing the GPIO pins on a Raspberry Pi without root for clients using SysV message queue and client/server

1.4.2(3y ago)168MITPHPPHP ^7.4||^8.0

Since Dec 13Pushed 3y agoCompare

[ Source](https://github.com/laxamar/GPIOSysV)[ Packagist](https://packagist.org/packages/laxamar/gpiosysv)[ RSS](/packages/laxamar-gpiosysv/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (55)Used By (0)

Amar: GPIOSysV
==============

[](#amar-gpiosysv)

[![License](https://camo.githubusercontent.com/6a82cef2543ffaa98e661fce727a1faa862b66f5fd89a48d19bf9d51824142c5/68747470733a2f2f706f7365722e707567782e6f72672f6c6178616d61722f6770696f737973762f6c6963656e7365)](https://packagist.org/packages/laxamar/gpiosysv)[![Total Downloads](https://camo.githubusercontent.com/bda754f88c9a7f8bd784aac114f47d778d1000dd63953244dcbdb6274277a04f/68747470733a2f2f706f7365722e707567782e6f72672f6c6178616d61722f6770696f737973762f646f776e6c6f616473)](https://packagist.org/packages/laxamar/gpiosysv)

A userland (non-root) library for low level access to the GPIO pins on a Raspberry Pi. These pins can be used to control outputs (LEDs, motors, valves, pumps) or read inputs (sensors).

Adapted by [laxamar ![(Twitter)](https://camo.githubusercontent.com/6bdedfb2ec11bea20e0fb9720641fd26240465c2361f25955ca995df499d5d20/687474703a2f2f692e696d6775722e636f6d2f77577a583975422e706e67)](https://twitter.com/laxamar)

From [AndrewCarterUK ![(Twitter)](https://camo.githubusercontent.com/6bdedfb2ec11bea20e0fb9720641fd26240465c2361f25955ca995df499d5d20/687474703a2f2f692e696d6775722e636f6d2f77577a583975422e706e67)](https://twitter.com/AndrewCarterUK)

Installing
----------

[](#installing)

This release has two components. A server that can be installed via git or composer. A client that uses composer to install and run.

### Client (with server as a service with manual installation)

[](#client-with-server-as-a-service-with-manual-installation)

Using [composer](https://getcomposer.org/):

`composer require laxamar/gpiosysv`

Or:

`php composer.phar require laxamar/gpiosysv`

The server code is installed in the `vendors/laxamar/gpiosysv` directory of composer under the `service` directory and can be installed as below

### Server

[](#server)

The server can be downloaded as by git `sudo install_systemd.sh`will install the necessary files in /usr/local/GPIOSysV and install the systemd service

Examples
--------

[](#examples)

### Setting Output Pins

[](#setting-output-pins)

```
use Amar\GPIOSysV\GPIOSysVClt;

// Create a GPIO object
$gpio_obj = GPIOSysVClt::getInstance();

// Set the value of the pin high (turn it on)
$success = $gpio_obj->setPinHigh(18);

$success = $gpio_obj->setPinLow(18);

// Set a series on PINs using BCD
$gpio->setPinsBinary($board, CS_PINs);
for ($dec = 0; $dec < 8; $dec++) {
    // echo "Decimal $dec";
    $gpio->strobeBinary($dec, LED_PINs, FLASH_PIN, 1, 0, $frequency, true, $error);
}
```

### Input Pin

[](#input-pin)

```
use Amar\GPIOSysV\GPIOSysVClt;

// Create a GPIO object
$gpio_obj = GPIOSysVClt::getInstance();

// Set the value of the pin high (turn it on)
$value = $gpio_obj->getPin(4);
```

Further Reading
---------------

[](#further-reading)

SitePoint published a tutorial about [powering Raspberry Pi projects with PHP](https://www.sitepoint.com/powering-raspberry-pi-projects-with-php/) which used this library and shows a push button example with a wiring diagram.

More Resources
--------------

[](#more-resources)

PiPHP maintains a [resource directory](https://github.com/PiPHP/Resources) for PHP programming on the Raspberry Pi.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 68.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

Every ~51 days

Recently: every ~88 days

Total

50

Last Release

1304d ago

Major Versions

v0.9.2 → v1.02021-10-16

PHP version history (2 changes)0.2.2PHP ^7.3||^8.0

v1.0PHP ^7.4||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/14a58e74118f76b85fa15ca210f5620dcbec0eb9a40b0dcdbafadc01edcc7438?d=identicon)[laxamar](/maintainers/laxamar)

---

Top Contributors

[![AndrewCarterUK](https://avatars.githubusercontent.com/u/6486835?v=4)](https://github.com/AndrewCarterUK "AndrewCarterUK (69 commits)")[![svpernova09](https://avatars.githubusercontent.com/u/967362?v=4)](https://github.com/svpernova09 "svpernova09 (26 commits)")[![IonBazan](https://avatars.githubusercontent.com/u/1985514?v=4)](https://github.com/IonBazan "IonBazan (2 commits)")[![laxamar](https://avatars.githubusercontent.com/u/2382057?v=4)](https://github.com/laxamar "laxamar (2 commits)")[![Sam-Burns](https://avatars.githubusercontent.com/u/6594039?v=4)](https://github.com/Sam-Burns "Sam-Burns (1 commits)")[![tomsseisums](https://avatars.githubusercontent.com/u/1030080?v=4)](https://github.com/tomsseisums "tomsseisums (1 commits)")

---

Tags

gpiophppi4bsysv-ipcpinsysvGPIOraspberrypinspino-root

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laxamar-gpiosysv/health.svg)

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

###  Alternatives

[piphp/gpio

A library for accessing the GPIO pins on a Raspberry Pi

4325.9k2](/packages/piphp-gpio)[ronanguilloux/php-gpio

GPIO-related utils &amp; toolkit PHP library

2678.0k](/packages/ronanguilloux-php-gpio)[lkallas/estonianpin

A simple library for processing Estonian Personal Identification Code (isikukood).

1615.7k](/packages/lkallas-estonianpin)

PHPackages © 2026

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