Skip to content
@rapira-rs

Rapira: a post-modern PHP application server.

Rapira is a PHP application server with extensions from the RoadRunner maintainers.

Rapira

A Rust application server for PHP.

Rapira website · Rapira documentation · Rapira quickstart · Rapira releases

About Rapira

Rapira is a Rust application server for PHP. The maintainers of RoadRunner develop Rapira. It uses the PHP embed SAPI to load non-thread-safe (NTS) PHP in the server process. Rapira calls the PHP interpreter directly. It does not use FastCGI, a socket between Rapira and PHP, or per-request serialization. Plugins extend Rapira.

Rapira has three execution modes:

  • Classic mode runs the front controller for each request. It can replace php-fpm for an existing PHP application. The application does not need code changes.
  • Worker mode keeps the application in memory. Rapira initializes the application one time for each worker and calls a handler for each request.
  • Dispatcher mode keeps the application in memory. It gives each HTTP request to the application as a Rapira\Http\Exchange object. Dispatcher is the default mode.

Getting started

Rapira release packages and tar archives include NTS PHP. You do not need to install PHP separately. Use the download page to select a file for your operating system, processor architecture, PHP version, and package format. Verify the file before installation. Follow the installation guide.

After installation, start an existing application in Classic mode:

rapira serve --mode classic public/index.php

Release packages and tar archives contain a fixed set of PHP extensions. See the current extension list. If your application needs other extensions, build a compatible NTS libphp with the required extensions. You do not need to rebuild Rapira.

Use the ghcr.io/rapira-rs/rapira:php8.4 or ghcr.io/rapira-rs/rapira:php8.5 container image. Each image uses scratch as its base. Rapira does not publish a latest tag. The image contains Rapira and libphp.so. It cannot run by itself. Copy its files into your application image. See the Docker instructions.

For more information, see the quickstart, Worker mode guide, and framework guides for Symfony, Laravel, and Yii 3.

Main repositories

  • The rapira repository contains the Rust server core and its integration with the PHP embed SAPI.
  • The sdk-php repository contains PSR-7 request factories and test utilities. The project publishes each SDK component as a separate Composer package.
  • The yii-runner-rapira repository contains the Yii 3 application runner for Worker mode.
  • The rapira-rs.github.io repository contains the source for the rapira.rs documentation site.

Contributing

Open PHP SDK issues in the sdk-php issue tracker. Open all other issues in the Rapira issue tracker. See the Rapira contribution guide for build and test instructions.

Pinned Loading

  1. rapira rapira Public

    SAPI core API used to integrate with PHP SAPI and provide API for plugins

    Rust 33

  2. rapira-windows rapira-windows Public

    Rapira build, with ZTS, for Windows OS with full feature parity.

    Rust

  3. contract contract Public

    PHP

  4. yii-runner-rapira yii-runner-rapira Public

    Web application runner for Rapira

    PHP

  5. testing-php testing-php Public

    Testing utilities for Rapira: provisions the server binary and runs a live server around your tests (split-published from rapira-rs/sdk-php)

    PHP

  6. rapira-rs.github.io rapira-rs.github.io Public

    Rapira documentation

    TypeScript

Repositories

Showing 9 of 9 repositories

Top languages

Loading…

Most used topics

Loading…