Skip to content
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/pr-wordpress-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- examples/wordpress-mariadb-mysql
- examples/wordpress-mysql8
- examples/wordpress-nginx
- examples/wordpress-recommended
lando-version:
- 3-edge
- 3-stable
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Updated `lando init` to set recommended PHP 8.3 and MySQL 8.0 versions in generated Landofile
* Added `wordpress-recommended` example with explicit version configuration
* Updated docs to recommend always setting explicit `php` and `database` versions
* Updated `@lando/php` to `^1.11.1`

## v1.10.0 - [February 20, 2026](https://github.com/lando/wordpress/releases/tag/v1.10.0)

* Updated `@lando/php` to `^1.11.0` for MySQL client auto-detection fix
Expand Down
41 changes: 29 additions & 12 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,32 @@ config:
vhosts: SEE BELOW
```

::: warning Always set explicit versions!
We **strongly recommend** always setting `php` and `database` versions in your Landofile rather than relying on defaults. Defaults may change between releases and could result in unexpected behavior. For WordPress, the current recommended versions are:

```yaml
recipe: wordpress
config:
php: '8.3'
database: mysql:8.0
```

See [WordPress server requirements](https://wordpress.org/about/requirements/) for the latest recommendations.
:::

Note that if the above config options are not enough, all Lando recipes can be further [extended and overriden](https://docs.lando.dev/landofile/recipes.html#extending-and-overriding-recipes).

## Choosing a php version

You can set `php` to any version that is available in our [php service](https://docs.lando.dev/plugins/php/index.html). However, you should consult the [WordPress requirements](https://wordpress.org/about/requirements/) to make sure that version is actually supported by WordPress itself.

The [recipe config](https://docs.lando.dev/landofile/recipes.html#config) to set the WordPress recipe to use `php` version `7.1` is shown below:
The [recipe config](https://docs.lando.dev/landofile/recipes.html#config) to set the WordPress recipe to use `php` version `8.3` is shown below:

```yaml
recipe: wordpress
config:
php: '7.1'
php: '8.3'
database: mysql:8.0
```
## Choosing a composer version

Expand All @@ -45,6 +59,8 @@ You can set `composer_version` to any version that is available in our [php serv
```yaml
recipe: wordpress
config:
php: '8.3'
database: mysql:8.0
composer_version: '1.10.1'
```

Expand All @@ -57,6 +73,8 @@ By default, this recipe will be served by the default version of our [apache](ht
```yaml
recipe: wordpress
config:
php: '8.3'
database: mysql:8.0
via: apache
```

Expand All @@ -65,6 +83,8 @@ config:
```yaml
recipe: wordpress
config:
php: '8.3'
database: mysql:8.0
via: nginx
```

Expand All @@ -81,30 +101,25 @@ Also note that like the configuration of the `php` version you should consult th
```yaml
recipe: wordpress
config:
database: mysql
php: '8.3'
database: mysql:8.0
```

#### Using MariaDB

```yaml
recipe: wordpress
config:
database: mariadb
php: '8.3'
database: mariadb:10.6
```

#### Using Postgres

```yaml
recipe: wordpress
config:
database: postgres
```

#### Using a custom version

```yaml
recipe: wordpress
config:
php: '8.3'
database: postgres:14
```

Expand Down Expand Up @@ -215,6 +230,8 @@ Note that you can put your configuration files anywhere inside your application
```yaml
recipe: wordpress
config:
php: '8.3'
database: mysql:8.0
config:
database: config/my-custom.cnf
php: config/php.ini
Expand Down
8 changes: 4 additions & 4 deletions examples/wordpress-init/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ Run the following commands to validate things are rolling as they should.
cd wordpress
lando exec appserver -- curl -L localhost | grep "WordPress"

# Should use 7.4 as the default php version
# Should use 8.3 as the default php version
cd wordpress
lando php -v | grep "PHP 7.4"
lando php -v | grep "PHP 8.3"

# Should be running apache 2.4 by default
cd wordpress
lando exec appserver -- apachectl -V | grep 2.4
lando exec appserver -- curl -IL localhost | grep Server | grep 2.4

# Should be running mysql 5.7 by default
# Should be running mysql 8.0 by default
cd wordpress
lando mysql -V | grep 5.7
lando mysql -V | grep 8.0

# Should not enable xdebug by default
cd wordpress
Expand Down
9 changes: 9 additions & 0 deletions examples/wordpress-recommended/.lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: wordpress-recommended
recipe: wordpress
config:
php: '8.3'
database: mysql:8.0

# do not remove this
plugins:
"@lando/wordpress": ../..
49 changes: 49 additions & 0 deletions examples/wordpress-recommended/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# WordPress Recommended Example

This example exists primarily to test the following documentation:

* [WordPress Recipe - Configuration](https://docs.lando.dev/wordpress/config.html)

This example uses the WordPress.org recommended versions of PHP and MySQL.

## Start up tests

Run the following commands to get up and running with this example.

```bash
# Should start up successfully
lando poweroff
lando start
```

## Verification commands

Run the following commands to validate things are rolling as they should.

```bash
# Should use php 8.3
lando php -v | grep "PHP 8.3"

# Should be running mysql 8.0
lando mysql -V | grep 8.0

# Should be running apache by default
lando exec appserver -- apachectl -V | grep 2.4
lando exec appserver -- curl -IL localhost | grep Server | grep 2.4

# Should be able to connect to the database with the default creds
lando mysql -uwordpress -pwordpress wordpress -e quit

# Should have the 2.x wp-cli
lando wp cli version | grep "WP-CLI 2."
```

## Destroy tests

Run the following commands to trash this app like nothing ever happened.

```bash
# Should be destroyed with success
lando destroy -y
lando poweroff
```
6 changes: 5 additions & 1 deletion inits/wordpress.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
'use strict';

/*
* Init Lamp
* Init WordPress
*/
module.exports = {
name: 'wordpress',
defaults: {
'php': '8.3',
'database': 'mysql:8.0',
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@lando/mssql": "^1.4.3",
"@lando/mysql": "^1.6.0",
"@lando/nginx": "^1.5.0",
"@lando/php": "^1.11.0",
"@lando/php": "^1.11.1",
"@lando/postgres": "^1.5.0",
"lodash": "^4.17.21"
},
Expand Down
Loading