Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions trellis/configuring-php.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
date_modified: 2025-04-01 00:00
date_modified: 2026-11-19 10:00
date_published: 2025-04-01 00:00
description: Configure PHP settings in Trellis by overriding default values. Adjust memory limits, max execution time, upload sizes, and other PHP directives per site.
title: Configuring PHP Settings in Trellis
Expand All @@ -15,11 +15,18 @@ If you make a change to the PHP settings, you will need to [reprovision](https:/
:::

## Change the version of PHP
Trellis uses PHP 8.4 by default as of [#1702](https://github.com/roots/trellis/pull/1702). Older versions of Trellis default to PHP 8.3.

In [`group_vars/all/main.yml`](https://github.com/roots/trellis/blob/master/group_vars/all/main.yml), set the value of `php_version` to the version you're working with.

e.g. to use PHP 8.1: `php_version: "8.1"`

As of [#1560](https://github.com/roots/trellis/pull/1560) Trellis supports 7.4 & 8.1 up to 8.4. Newer versions may work when released but may not have been tested by the community yet - you can help by testing yourself and reporting your progress on [Roots Discourse](https://discourse.roots.io/).
Trellis installs PHP from the [Sury repository](https://deb.sury.org/), and since [#1511](https://github.com/roots/trellis/pull/1511) the PHP role isn't tied to specific versions. Any `php_version` that Sury packages for your Ubuntu release will work, as long as:

* Every extension Trellis installs has a package for that version. This covers the defaults plus `memcached`, `redis` and `xdebug` if you use them. PECL extensions such as `imagick` and `xmlrpc` are often published a few weeks after a new PHP release.
* [WP-CLI](https://github.com/wp-cli/wp-cli/releases) supports it. WP-CLI 2.12.0, which Trellis installs, supports up to PHP 8.4.

If you try a newer version, you can help by reporting how it went on [Roots Discourse](https://discourse.roots.io/).

## Changing the default extensions
Trellis will look for a version-specific override file before falling back to the default PHP extensions. If you'd like to change the extensions installed on your environments, duplicate the [`roles/php/vars/version-specific-defaults.yml`](https://github.com/roots/trellis/blob/master/roles/php/vars/version-specific-defaults.yml) file and rename it to the version of PHP you are targetting.
Expand Down
4 changes: 2 additions & 2 deletions trellis/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
date_modified: 2026-11-03 10:00
date_modified: 2026-11-19 10:00
date_published: 2015-10-15 12:20
description: Install Trellis for WordPress projects. Complete setup instructions covering requirements, dependencies, project initialization, and initial configuration.
title: Installing Trellis for WordPress
Expand Down Expand Up @@ -90,7 +90,7 @@ with a single command thanks to trellis-cli too.

Trellis provisions a base Ubuntu 26.04 server by installing and configuring the following software:

* PHP 8.3+
* PHP 8.4+
* Nginx (including HTTP/2, HTTP/3, and optional FastCGI micro-caching)
* MariaDB (a drop-in MySQL replacement)
* SSL support (scores an A+ on the [Qualys SSL Server Test](https://www.ssllabs.com/ssltest/))
Expand Down
Loading