phpacker

Getting Started

All configuration options can be passed as command arguments. For a version-tracked way to do this, check out the config section to track all options in a config file.

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 architecture
phpacker build mac arm --src=./app.phar
 
# Build for all supported platforms
phpacker build all --src=./app.phar
 
# Build with custom output directory
phpacker build --src=./app.phar --dest=./custom-build-path
 
# Build with a specific PHP configuration file
phpacker build --src=./app.phar --ini=./custom-php.ini
 
# Prompt INI definitions interactively
phpacker build --src=./app.phar --ini
 
# Build with with php version
phpacker 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]

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.