PHPackages                             m3m0r7/nfc-for-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. m3m0r7/nfc-for-php

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

m3m0r7/nfc-for-php
==================

NFC Reader written in PHP

0.2.3(4y ago)281055MITPHPPHP &gt;=7.4|&gt;=8

Since Oct 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/m3m0r7/nfc-for-php)[ Packagist](https://packagist.org/packages/m3m0r7/nfc-for-php)[ RSS](/packages/m3m0r7-nfc-for-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (5)Versions (9)Used By (0)

What is nfc-for-php?
====================

[](#what-is-nfc-for-php)

This library is a toy for me. You can read NFC with libnfc written in PHP.

Requirements
============

[](#requirements)

- PHP 7.4+
- PHP FFI
- libnfc 1.8.0 (*if you use NFC reader for PaSoRi RC-S330*)
- libusb 1.0.24 (*if you use NFC reader for PaSoRi RC-S380*)

Tested
======

[](#tested)

- OS
    - Mac Big Sur
    - RaspberryPi (Raspbian)
- FeliCa
    - PASMO
    - Suica
    - KONAMI e-AMUSEMENT pass
    - Pixel5
- PaSoRi RC-S330
    - You **cannot** touch Apple Wallet on iOS
    -
- PaSoRi RC-S380 (experimental)
    - Supported only to a FeliCa
    - You can touch Apple Wallet on iOS
    -

[![](images/pasori.jpg)](images/pasori.jpg)

Quick start
===========

[](#quick-start)

Mac
---

[](#mac)

### RC-S330

[](#rc-s330)

1. Install libnfc

```
$ brew install libnfc

```

2. Install this library

```
$ composer require m3m0r7/nfc-for-php

```

3. Connect NFC Device into your machine.
4. Run example code

```
$ cd /path/to/nfc-for-php
$ php examples/nfc-poll-simple.php

```

5. Put your NFC

[![](images/felica.png)](images/felica.png)

6. You can get output.

[![](images/example.jpg)](images/example.jpg)

### RC-S380

[](#rc-s380)

1. Install libusb

```
$ brew install libusb

```

2. Install this library

```
$ composer require m3m0r7/nfc-for-php

```

3. Connect NFC Device into your machine.
4. Run example code

```
$ cd /path/to/nfc-for-php
$ php examples/rcs380-nfc-poll-simple.php

```

5. Put your NFC
6. You can get output.

NFC binary
==========

[](#nfc-binary)

We're providing NFC binary in `vendor/bin`. And you can use 3 commands `start`, `ls` and `version`

start
-----

[](#start)

Start to listen NFC reader.

```
./vendor/bin/nfc start

```

You can change the driver if you want to use other driver.

```
./vendor/bin/nfc start -D DriverName

```

You can specify hook events in CLI command.

```
./vendor/bin/nfc start -E /path/to/events.php

```

For example, you can use example file.

```
./vendor/bin/nfc start -E ./vendor/m3m0r7/nfc-for-php/examples/event-manager.php

```

And you want to more details, please run below command.

```
./vendor/bin/nfc start --help

```

ls
--

[](#ls)

Show available devices.

```
./vendor/bin/nfc ls

```

You can change the driver if you want to use other driver.

```
./vendor/bin/nfc ls -D DriverName

```

And you want to more details, please run below command.

```
./vendor/bin/nfc ls --help

```

version
-------

[](#version)

Show PHP driver version.

```
./vendor/bin/nfc version

```

You can change the driver if you want to use other driver.

```
./vendor/bin/nfc version -D DriverName

```

And you want to more details, please run below command.

```
./vendor/bin/nfc version --help

```

How to use
==========

[](#how-to-use)

- See examples

Troubleshooting
===============

[](#troubleshooting)

Q. How to recognize a device?
-----------------------------

[](#q-how-to-recognize-a-device)

A. You must have granted permission to user. I already test on RaspberryPI (Raspbian), it should grant to access permission to `/dev/*` or using super user (e.g., the root user). If you did not have permissions, cannot recognize a device on your environment and the libusb return an error `LIBUSB_ERROR_ACCESS`.

Q. Cannot start second time or later on macOS
---------------------------------------------

[](#q-cannot-start-second-time-or-later-on-macos)

A. You must reconnect the connected USB plug because libnfc/libusb return an invalid packet in the macOS when second time or later. I don't know how to fix it.

License
=======

[](#license)

- MIT

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

8

Last Release

1711d ago

### Community

Maintainers

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

---

Top Contributors

[![m3m0r7](https://avatars.githubusercontent.com/u/1282995?v=4)](https://github.com/m3m0r7 "m3m0r7 (110 commits)")

---

Tags

ffinfcphp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/m3m0r7-nfc-for-php/health.svg)

```
[![Health](https://phpackages.com/badges/m3m0r7-nfc-for-php/health.svg)](https://phpackages.com/packages/m3m0r7-nfc-for-php)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[phpactor/phpactor

PHP refactoring and intellisense tool for text editors

1.9k16.6k1](/packages/phpactor-phpactor)[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)
