Build & Deploy
PHP

PHP

Detection

PHP applications are detected when the application contains a composer.json file in the root of your project directory.

Even if your application does not require Composer to run, the file must be present to signal that your app is a PHP application. If your project doesn't actually require Composer, the file should contain the following:

composer.json
{}

Runtime

If a PHP version is not specified in your composer.json file, your application will be built using the PHP 8 runtime. To specify a specific runtime, add the following instruction to your composer.json file:

composer.json
{
...
  "require": {
    "php": "^8.2"
  }
...
}
⚠️

Never define a specific version, like 8.2.3. Instead, use the "next significant release" operators (^ or ~) (opens in a new tab) to ensure that you use the most up-to-date compatible version for your code.