Skip to main content
In addition to inputs, setup-php supports a set of environment flags that control how the action behaves. Set them using the env: keyword on the setup-php step.

Workflow flags

boolean
default:"false"
When set to true, the workflow fails immediately if an extension or tool cannot be set up, instead of continuing with a warning in the logs.By default, failures to add or disable extensions and failures to install tools (other than composer) produce a log warning without interrupting the workflow.
string
default:"nts"
Controls whether to set up a thread-safe (TS/ZTS) or non-thread-safe (NTS) build of PHP.
boolean
default:"false"
When set to true, updates the pre-installed PHP version on the runner to the latest patch release before setting up.By default, pre-installed PHP versions are not updated to their latest patch. Set this flag when you need the latest bug fixes and security patches for a given minor version.
You can combine this with php-version: pre-installed to update whichever PHP version is already installed on the runner:
boolean
When set to true, sets up a PHP build that includes debugging symbols. Supported for PHP 5.6 and above.Platform-specific behavior:
  • Linux — Debug symbols are added as separate debug info files under /usr/lib/debug/.build-id. Tools like gdb resolve them automatically.
  • Windows — Debug symbols are added as .pdb files in the PHP installation directory.
  • macOS — Debug symbols are compiled into the binaries.
string
Set to self-hosted when running on a self-hosted runner. This tells setup-php to adjust its behavior for non-GitHub-hosted environments.
Do not run multiple self-hosted runners on the same server instance — parallel workflows will conflict. Avoid using the same labels as GitHub-hosted runners.

Composer flags

string
A comma-separated list of Composer plugin package names to add to the allow list.By default, Composer blocks all plugins. Plugins installed via the tools input are automatically allowed. Use this flag to allow plugins that are required by your dependencies rather than installed directly.
string
Authentication token for Private Packagist. Set this when your workflow installs private Composer dependencies hosted on Private Packagist.
string
A JSON string containing Composer authentication credentials for private repositories not hosted on GitHub or Private Packagist. Follows the same format as Composer’s auth.json.
number
Overrides the Composer process timeout (in seconds). By default, setup-php sets this to 0 (no timeout), so Composer commands in your scripts do not time out.Set this to a positive integer if you want to enforce a timeout limit on Composer operations.