Runway

PHP

Buildpacks allow for various configuration options (through BP_PHP_* or BP_COMPOSER_* variables in project.toml or via the environment), we try to auto-detect what’s best so here is a summary.

When does it run?

Auto-detection runs as soon as we discover a composer.json file in your project.

Auto-detected settings

BP_COMPOSER_INSTALL_OPTIONS is set to --no-dev --no-scripts --ignore-platform-reqs. The first two are self-explanatory when you work with PHP and Composer on a daily basis, the last one is due to how buildpacks works. After composer install is performed, the buildpacks run a detection of your requirements and automatically create a .php.ini.d/custom.ini inside your project, which takes care of loading the required PHP extensions or polyfills for your code.

We attempt to find your project’s documentroot and set BP_PHP_WEB_DIR accordingly. Possible values are htdocs, public and www. If your code is located somewhere else, you should set this.

When we discover your documentroot successfully, then we set BP_PHP_SERVER to httpd. An alternative is to set this to nginx yourself.

BP_PHP_ENABLE_HTTPS_REDIRECT is set to false and therefor disabled on Runway by default. All our domains provide SSL.

Override

When you set your own values, these values are always respected and we will stop adding them.