# How to switch PHP version

Each application on TurboStack runs its own PHP version in its own PHP-FPM pool, so you can change one
application's version without affecting the others. TurboStack supports a range of versions - for
example `8.4`, `8.3` and `8.2`. Older versions can still be installed if your application needs them,
but they may no longer receive security updates. The version dropdown lists the versions available now.

## Switch it in the GUI

1. Open the host and select the application.
2. Go to **Configure application > Technologies > PHP**.
3. Choose the version and save.

![Selecting the PHP version on an application's Technologies tab|1000](../../assets/screenshots/technologies/php.png)

## Switch it in YAML

Set `php_version` on the application (vhost). The version must be installed on the host - it is listed in
the host-level `php_versions`, with `php_main_version` as the host default. See
[The Source (YAML) view](../../concepts/yaml-view.md).

```yaml
php_version: "8.4"
```

[Publish](../../platform/hosts/publishing.md) the change to apply it.

## Verify the active version

- **Web:** open a temporary `phpinfo()` page (see [Override PHP settings](override-php-settings.md))
  and check the version at the top, then delete the file.
- **Command line:** each installed version also has its own binary at `/usr/bin/php<version>`
  (for example `/usr/bin/php8.4 -v`). The default `php` on the command line may differ from
  the application's version.

> [!WARNING]
> Test your application against the new version on a staging copy before switching a production site -
> a major PHP jump can break incompatible code or extensions.

## Related

- [Configure PHP](configure.md)
- [Override PHP settings](override-php-settings.md)
- [Flush the PHP OPcache](flush-opcache.md)
- [Publishing changes](../../platform/hosts/publishing.md)
- [Applications](../../applications/index.md)
