godruoyi/rust-php-extension-sample

Installation script for sample rust php extension

v0.0.8 2025-03-23 09:31 UTC

This package is auto-updated.

Last update: 2025-03-23 09:34:05 UTC


README

This is a test project, mainly used to explore how to install PHP extensions that are written in Rust. The goal is to create a Composer package that can install the PHP extension directly without using PECL or PIE.

Installation

First, install this package:

composer require godruoyi/rust-php-extension-sample

Then, install the PHP extension by running the following command:

vendor/bin/install-sample-extension

Goals

  • Write a simple PHP extension in Rust
  • Build and publish the pre-compiled extension to GitHub releases by using GitHub Actions
  • Install the extension through Composer
    • Add post-install script in composer.json to download the pre-compiled extension
    • Make sure the pre-compiled extension is matched with user's OS and PHP version
    • Exit and show error message if the extension is not available for the user's OS and PHP version
    • Investigate is it possible to build the extension on the user's machine
    • Using composer-plugin for the installation script
  • Test the extension in a PHP script
  • These all operations should be integrated with GitHub Actions