PHPackages                             masakielastic/llhttp - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. masakielastic/llhttp

ActivePhp-ext[HTTP &amp; Networking](/categories/http)

masakielastic/llhttp
====================

PHP extension for llhttp - high-performance HTTP parser

v0.1.0(2mo ago)02MITCPHP &gt;=8.1

Since Feb 25Pushed 2mo agoCompare

[ Source](https://github.com/masakielastic/php-ext-llhttp)[ Packagist](https://packagist.org/packages/masakielastic/llhttp)[ RSS](/packages/masakielastic-llhttp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP llhttp Extension
====================

[](#php-llhttp-extension)

A PHP extension that provides high-performance HTTP parsing using the [llhttp](https://github.com/nodejs/llhttp) C library. This extension offers a simple, direct API for parsing HTTP requests and responses with excellent performance.

Features
--------

[](#features)

- **High Performance**: Built on the fast llhttp C library used by Node.js
- **Simple API**: Clean, direct method calls without complex event systems
- **Object-Oriented**: Modern PHP interface with intuitive methods
- **Request &amp; Response Parsing**: Support for both HTTP requests and responses
- **Built-in Data Collection**: Automatic header, URL, and body collection
- **Memory Efficient**: Streaming parser that handles large HTTP messages
- **State Management**: Reset and reuse parsers efficiently

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

[](#installation)

### Requirements

[](#requirements)

- PHP 8.0 or higher
- PHP development headers (`php-dev` package)
- C compiler (gcc/clang)
- autotools (autoconf, automake, libtool)

### Install with PIE

[](#install-with-pie)

[PIE](https://github.com/php/pie) (PHP Installer for Extensions) is the recommended installation method.

```
pie install masakielastic/llhttp
```

### Build from Source

[](#build-from-source)

```
# Clone the repository
git clone https://github.com/yourusername/php-ext-llhttp.git
cd php-ext-llhttp

# Build the extension
phpize
./configure
make

# Install (requires sudo)
sudo make install

# Add to php.ini
echo "extension=llhttp.so" >> /etc/php/8.x/cli/php.ini
```

Usage
-----

[](#usage)

### Basic HTTP Request Parsing

[](#basic-http-request-parsing)

```
