This topic provides a migration guide from the v2 PHP Buildpack for Tanzu Application Service for VMs to the Tanzu PHP Buildpack. By following this guide, you can migrate your existing PHP applications running on Tanzu Application Service for VMs to Tanzu Application Service for Kubernetes or Tanzu Build Service.
The v2 PHP Buildpack bundled a number of third-party integrations with partner utilities including Appdynamics, Contrast Security, Dynatrace, New Relic, Synopsys, and Snyk. The v3 PHP Buildpack does not yet include these integrations.
buildpack.yml file in your application source to specify a version of the PHP distribution as follows:
php: # Use the version field to specify a version constraint # for the PHP dependency. Any valid semver constraint # (e.g. 1.2.*) is acceptable. version: 7.*
buildpack.yml file in your application source to specify the webdirectory used by PHP as follows:
php: # Use the webdirectory field to specify the root directory of the # files served by the web server, if applicable. webdirectory: “htdocs”
buildpack.yml file in your application source to specify the configuration of
composer as follows:
composer: # Use the version field to specify a version constraint # for the composer dependency. Any valid semver constaint # (e.g. 1.* and 1.10.*) is acceptable. version: 1.10.* # Use the install_options field to specify extra options # to pass to the composer installation process. The default # value is ["--no-dev"] install_options: ["--no-dev"] # Use the vendor_directory field to specify the location # of vendored dependencies for composer to use during # installation. The default value is "vendor" vendor_directory: vendor # Use the json_path field to specify the location of the # composer.json file. The default value is the root directory # of the application source code. json_path: composer # Use the install_global field to force the build process # to run `composer global` with a specified set of arguments. install_global: ["list", "of", "install", "options"]
The v3 PHP Buildpack will no longer search for configuration in the
.bp-config directory. This configuration can be moved to new locations as described below:
.bp-config/httpd/extra/httpd-modules.confshould be moved to
.bp-config/php.ini.d/<filename>.inishould be moved to
.bp-config/php/fpm.d/*should be moved to
index.php) that are in the application root into a directory called
htdocs. If your program entrypoint is not located in a directory called
htdocs, you should move it manually, or leverage the
php.webdirectoryfield in the
buildpack.ymlfile to specify an alternative that the buildpack will follow.
composer.jsonfile is present without a
composer.lockfile also being present.
composerCLI will not be installed unless a
composer.lockfile are both present in the application source code. If these files are not present in the root of the application source code, you can specify a custom location using the
composer.json_pathfield in your
The following workflows are not currently supported in the Tanzu PHP Buildpack:
.profile.ddirectory containing scripts to be run just before application launch is not currently supported. These scripts will be ignored during launch.
The following workflows existed in the v2 PHP Buildpack and will not be supported in the Tanzu PHP Buildpack:
.extensionsdirectory will not be supported.
geoipextension. The configuration helpers from the v2 PHP Buildpack are not available. However, the geoip extension can still be configured via the