Skip to content

Compile your app into a single binary #331

@theofidry

Description

@theofidry

Feature Request

PHARs are a format that allows one to "compile" your application into a single file. Box also supports Docker to allow one to depend only on Docker and no longer on the PHP version installed on the machine.

An alternative to Docker could be to compile PHP statically with the necessary extensions. This way you would have two files:

  • The PHAR
  • The static PHP binary

Both could then be shipped in a self-extracting file. This also opens up the path to allow to package the application as a debian, ubuntu or OSX package without too much trouble.

The only known limitation would be if the application depends on a PHP extension that depends on a system library or extensions that cannot be compiled statically. Examples:

  • Xdebug is a PHP extension that cannot be compiled statically
  • ext-intl which depends on icu4c. If the link to the icu4c binary is hard-coded in the statically compiled extension, then the extension will work properly only on one machine

Resources:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions