Anybuild documentation
PHP
Composer-aware PHP builds with framework-specific document-root detection.
Detection
The PHP provider recognizes Composer projects, PHP entry files, and Drupal, Moodle, or Symfony layouts. Laravel and WordPress projects use their dedicated providers.
Build and document root
Anybuild discovers Composer usage and build scripts, then selects a framework-specific document root such as public, app, or web. The current default PHP version is 8.3.29.
Configuration
| Variable | Purpose | Example value |
|---|---|---|
ANYBUILD_PHP_VERSION | Select the PHP package version. | 8.3.29 |
ANYBUILD_PHP_ARCHITECTURE | Select the 64-bit or 32-bit PHP package. | 64-bit |
ANYBUILD_COMPOSER_ENABLE | Control Composer installation. | true |
ANYBUILD_COMPOSER_BUILD_SCRIPT | Select the Composer build script to run. | post-update-cmd |
ANYBUILD_PHP_PUBLIC_DIR | Override the document root. | public |
ANYBUILD_PHPIX | Use the phpix runtime path. | true |
ANYBUILD_PHPIX_WORKER_THREADS | Set the phpix worker-thread count. | 4 |
Generated definition
Anybuild
load("//anybuild/tools:php.bzl", "php_build", "php_config", "php_serve")
config = php_config( schema = 1, composer_enable = True, php_version = "8.3.29", php_public_dir = "public",)
build = php_build(config)php_serve(config, build, name = "php-api")