Getting Started
Basic Build Commands
When you don't provide any input you'll be prompted through setting the basics. You may also pass these as arguments to the build command.
# Build for specific platform and architecturephpacker build mac arm --src=./app.phar # Build for all supported platformsphpacker build all --src=./app.phar # Build with custom output directoryphpacker build --src=./app.phar --dest=./custom-build-path # Build with a specific PHP configuration filephpacker build --src=./app.phar --ini=./custom-php.ini # Prompt INI definitions interactivelyphpacker build --src=./app.phar --ini # Build with with php versionphpacker build --src=./app.phar --php=8.3
# Build for specific platform and architecturephpacker build mac arm --src=./app.phar # Build for all supported platformsphpacker build all --src=./app.phar # Build with custom output directoryphpacker build --src=./app.phar --dest=./custom-build-path # Build with a specific PHP configuration filephpacker build --src=./app.phar --ini=./custom-php.ini # Prompt INI definitions interactivelyphpacker build --src=./app.phar --ini # Build with with php versionphpacker build --src=./app.phar --php=8.3
Build Output
The default build process creates executables within the build directory with the following naming pattern:
{dest}/{platform}/{platform}-{architecture}[.exe]
{dest}/{platform}/{platform}-{architecture}[.exe]
Supported Platforms
Platform | Architecture | PHP Versions |
---|---|---|
macOS | arm64, x64 | 8.2, 8.3, 8.4 |
Linux | arm64, x64 | 8.2, 8.3, 8.4 |
Windows | x64 | 8.2, 8.3, 8.4 |
PHP Extensions
At the core of PHPacker are our pre-compiled, platform-specific PHP binaries — portable, statically-compiled versions of PHP.
These binaries include a carefully selected set of the most essential PHP extensions required to run virtually any CLI application.
PHPacker prioritizes consistent behavior across all platforms, ensuring your apps run reliably whether on Windows, macOS, or Linux. We only include extensions that work consistently across all supported operating systems.
View the complete list of extensions included in our default binaries here .
Our binaries are built using the powerful static-php-cli library. You can also use this tool to create custom PHP binaries with your preferred extensions. For more information, see the Custom PHP Builds section.