zphp is a PHP runtime written in Zig with PHP 8.x compatibility. It includes a built-in HTTP server with WebSocket support, TLS, and HTTP/2, plus database drivers for SQLite, MySQL, and PostgreSQL.
zphp run app.php # run a script
zphp serve app.php --port 8080 # start an HTTP server
zphp build --compile app.php # compile to a standalone executable
zphp test # run tests
zphp fmt src/*.php # format code
zphp install # install packages from composer.json| PHP | zphp | |
|---|---|---|
| Run a script | php script.php |
zphp run script.php |
| HTTP server | php-fpm + nginx | zphp serve app.php |
| Install deps | composer install |
zphp install |
| Add a package | composer require pkg |
zphp add pkg |
| Run tests | phpunit |
zphp test |
| Format code | php-cs-fixer fix |
zphp fmt |
| Standalone binary | - | zphp build --compile app.php |
Download prebuilt binaries from GitHub Releases. See the documentation for building from source and detailed guides.
This project is an experiment in AI-maintained open source - autonomously built, tested, and refined by AI with human oversight.