An all-in-one PHP distribution for modern development
A single binary that includes PHP runtime, web server, package manager, and all common extensions.
No more juggling multiple tools or fighting with PHP installations.
- Single Binary — One download, everything included. No dependencies, no setup.
- Integrated Web Server — Development server with worker mode (like FrankenPHP) and file watching.
- Composer-Compatible Package Manager — Fast, native package management that works with existing
composer.jsonfiles. - All Extensions Included — Common extensions pre-compiled and ready to use.
- Project Configuration — Simple
pox.tomlfile for PHP settings and server config.
# Run a PHP script
pox script.php
# Start development server
pox server
# Install dependencies (reads composer.json)
pox install
# Add a package
pox add vendor/packageEach pipeline run includes as artifact a prebuilt binary for your platform.
git clone https://github.com/shyim/pox
cd pox
cargo build --releaseRequires a PHP installation compiled with embed SAPI (--enable-embed). Set PHP_CONFIG environment variable to point to your PHP installation.
pox 0.1.0 - PHP embedded in Rust
Usage: pox [options] <file> [args...]
pox [options] -r <code> [args...]
pox <command> [options]
Options:
-d key[=value] Define INI entry
-i Show PHP info
-l Syntax check (lint)
-m Show compiled modules
-r <code> Run PHP code
-v Version info
-h, --help Show help
Commands:
server Start development server
init Create new composer.json
install, i Install dependencies
update Update dependencies
add, require Add a package
remove, rm Remove a package
run Run composer script
pm Package manager commands
pox pm show # Show package info
pox pm search <query> # Search Packagist
pox pm outdated # List outdated packages
pox pm audit # Security vulnerability check
pox pm why <package> # Show why package is installed
pox pm dump-autoload # Regenerate autoloader
pox pm exec <binary> # Run vendored binary
pox pm clear-cache # Clear package cacheCreate a pox.toml in your project root:
# PHP runtime settings
[php.ini]
memory_limit = "256M"
display_errors = "On"
error_reporting = "E_ALL"
# Development server
[server]
host = "0.0.0.0"
port = 8080
document_root = "public"
router = "index.php"
# Worker mode (optional)
# worker = "worker.php"
# workers = 4
# watch = ["**/*.php"]- CLI arguments (
-d memory_limit=512M) pox.tomlsettings- Built-in defaults
pox server
pox server --port 8080 --document-root public
pox server public/index.php # With router scriptLong-running PHP processes for better performance (similar to FrankenPHP):
pox server --worker worker.php --workers 4Auto-restart workers when files change:
pox server --worker worker.php --watch "**/*.php"PHPox includes a Composer-compatible package manager written in Rust. It reads and writes standard composer.json and composer.lock files.
# Initialize new project
pox init
# Install from lock file
pox install
# Update dependencies
pox update
# Add packages
pox add laravel/framework
pox add --dev phpunit/phpunit
# Remove packages
pox remove vendor/package- Full dependency resolution (SAT solver)
- PSR-0, PSR-4, classmap, and files autoloading
- Private repositories and authentication
- Platform requirements checking
- Lock file compatibility with Composer
PHPox is built as a Rust workspace with these crates:
| Crate | Description |
|---|---|
pox-cli |
Main CLI binary, web server, command handling |
pox-embed |
FFI bindings to PHP's embed SAPI |
pox-pm |
Package manager (solver, repositories, autoload) |
pox-semver |
Semantic versioning for Composer constraints |
pox-spdx |
SPDX license identifier validation |
Contributions welcome! See the Feature Roadmap for planned features.
# Build
cargo build
# Run tests
cargo test
# Run specific crate tests
cargo test -p pox-pmMIT
