PHPackages                             php-io-extensions/ftdi - 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. php-io-extensions/ftdi

ActivePhp-ext[Utility &amp; Helpers](/categories/utility)

php-io-extensions/ftdi
======================

The PHP FTDI Extension - bindings for libftdi1

0.4.3(2w ago)012MITCPHP &gt;=8.3

Since May 21Pushed 2w agoCompare

[ Source](https://github.com/php-io-extensions/ftdi)[ Packagist](https://packagist.org/packages/php-io-extensions/ftdi)[ RSS](/packages/php-io-extensions-ftdi/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (6)Used By (0)

Ftdi - The FTDI extension for direct libftdi1 bindings.
=======================================================

[](#ftdi---the-ftdi-extension-for-direct-libftdi1-bindings)

This project provides direct bindings to [libftdi1](https://www.intra2net.com/en/developer/libftdi/).

Extension repository:

Highlights
----------

[](#highlights)

- Direct access to libftdi1 functions from PHP
- Support for serial-only devices (such as FT232RL) and MPSSE-capable devices (such as FT232H)
- USB open/read/write/flush/reset operations
- EEPROM read/write/decode/build operations
- Asynchronous transfer submission and completion

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

[](#requirements)

- PHP 8.3+
- **libftdi1** — required at compile and runtime
    - Debian/Ubuntu/Raspberry Pi OS: `libftdi1-dev` (runtime: `libftdi1-2`)
    - macOS: `brew install libftdi`
- If your intended workflow includes MPSSE device usage, install **mpsse** as well

Compilation Requirements
------------------------

[](#compilation-requirements)

- A C language toolchain
- **libftdi1** development headers and pkg-config metadata (see Requirements)
- Manual installation

    - Zephir PHP
    - ext-zephir\_parser
- Automated installation

    - PIE

Manual compilation instructions
-------------------------------

[](#manual-compilation-instructions)

### Zephir

[](#zephir)

- Clone this repository and checkout the release to use (or master for the latest updates)
- `cd ftdi`
- Install **libftdi1** if it is not already present (see Requirements)
- This extension is intended to be used with MPSSE-capable devices (for example FT232H) and serial-only devices (for example FT232RL)
- If MPSSE is intended, install **mpsse** as well
- The installers include procedures to do this for you. However, if they are already installed, using PIE is easiest.
- Run the installer for your platform
    - Raspberry Pi / Debian Trixie: `bash install-debian-trixie.sh`
    - macOS: `bash install-macos.sh`

### PIE

[](#pie)

If dependencies are already installed, using PIE is the easiest path:

- Clone this repository and checkout the release to use (or master for the latest updates)
- `cd ftdi`
- `pie install`

Do **not** run `sudo pie install` from a development checkout — that can leave root-owned files under `ext/` and break later builds. Use `pie install` (it prompts only for the final install step) or the platform install scripts above.

Automated compilation instructions
----------------------------------

[](#automated-compilation-instructions)

- Ensure **libftdi1** is installed first
- If MPSSE usage is intended, ensure **mpsse** is installed as well
- `pie install php-io-extensions/ftdi`
- PIE should compile the extension and place it where your default PHP binary expects extensions
- If PIE does not automatically enable the extension, add it to your `php.ini`:

    ```
    extension=ftdi
    ```

Confirm the module is loaded:

```
php -m | grep ftdi
```

Usage
-----

[](#usage)

FTDI bindings are invoked through the `Ftdi\FTDI` class. All methods are static.

```
