Skip to content

Commit cdf4daa

Browse files
committed
feat: promote recommended PHP and database versions in init and docs
- Updated lando init to set PHP 8.3 and MySQL 8.0 in generated Landofile - Added wordpress-recommended example with explicit version configuration - Updated docs to recommend always setting explicit php and database versions - Bumped @lando/php to ^1.11.1
1 parent 7f07b21 commit cdf4daa

10 files changed

Lines changed: 110 additions & 25 deletions

File tree

.github/workflows/pr-wordpress-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
- examples/wordpress-mariadb-mysql
2424
- examples/wordpress-mysql8
2525
- examples/wordpress-nginx
26+
- examples/wordpress-recommended
2627
lando-version:
2728
- 3-edge
2829
- 3-stable

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})
22

3+
* Updated `lando init` to set recommended PHP 8.3 and MySQL 8.0 versions in generated Landofile
4+
* Added `wordpress-recommended` example with explicit version configuration
5+
* Updated docs to recommend always setting explicit `php` and `database` versions
6+
* Updated `@lando/php` to `^1.11.1`
7+
38
## v1.10.0 - [February 20, 2026](https://github.com/lando/wordpress/releases/tag/v1.10.0)
49

510
* Updated to [@lando/php@1.11.0](https://github.com/lando/php/releases/tag/v1.11.0)

docs/config.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,32 @@ config:
2525
vhosts: SEE BELOW
2626
```
2727
28+
::: warning Always set explicit versions!
29+
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:
30+
31+
```yaml
32+
recipe: wordpress
33+
config:
34+
php: '8.3'
35+
database: mysql:8.0
36+
```
37+
38+
See [WordPress server requirements](https://wordpress.org/about/requirements/) for the latest recommendations.
39+
:::
40+
2841
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).
2942

3043
## Choosing a php version
3144

3245
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.
3346

34-
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:
47+
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:
3548

3649
```yaml
3750
recipe: wordpress
3851
config:
39-
php: '7.1'
52+
php: '8.3'
53+
database: mysql:8.0
4054
```
4155
## Choosing a composer version
4256

@@ -45,6 +59,8 @@ You can set `composer_version` to any version that is available in our [php serv
4559
```yaml
4660
recipe: wordpress
4761
config:
62+
php: '8.3'
63+
database: mysql:8.0
4864
composer_version: '1.10.1'
4965
```
5066

@@ -57,6 +73,8 @@ By default, this recipe will be served by the default version of our [apache](ht
5773
```yaml
5874
recipe: wordpress
5975
config:
76+
php: '8.3'
77+
database: mysql:8.0
6078
via: apache
6179
```
6280

@@ -65,6 +83,8 @@ config:
6583
```yaml
6684
recipe: wordpress
6785
config:
86+
php: '8.3'
87+
database: mysql:8.0
6888
via: nginx
6989
```
7090

@@ -81,30 +101,25 @@ Also note that like the configuration of the `php` version you should consult th
81101
```yaml
82102
recipe: wordpress
83103
config:
84-
database: mysql
104+
php: '8.3'
105+
database: mysql:8.0
85106
```
86107

87108
#### Using MariaDB
88109

89110
```yaml
90111
recipe: wordpress
91112
config:
92-
database: mariadb
113+
php: '8.3'
114+
database: mariadb:10.6
93115
```
94116

95117
#### Using Postgres
96118

97119
```yaml
98120
recipe: wordpress
99121
config:
100-
database: postgres
101-
```
102-
103-
#### Using a custom version
104-
105-
```yaml
106-
recipe: wordpress
107-
config:
122+
php: '8.3'
108123
database: postgres:14
109124
```
110125

@@ -215,6 +230,8 @@ Note that you can put your configuration files anywhere inside your application
215230
```yaml
216231
recipe: wordpress
217232
config:
233+
php: '8.3'
234+
database: mysql:8.0
218235
config:
219236
database: config/my-custom.cnf
220237
php: config/php.ini

examples/wordpress-init/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ Run the following commands to validate things are rolling as they should.
3232
cd wordpress
3333
lando exec appserver -- curl -L localhost | grep "WordPress"
3434

35-
# Should use 7.4 as the default php version
35+
# Should use 8.3 as the default php version
3636
cd wordpress
37-
lando php -v | grep "PHP 7.4"
37+
lando php -v | grep "PHP 8.3"
3838

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

44-
# Should be running mysql 5.7 by default
44+
# Should be running mysql 8.0 by default
4545
cd wordpress
46-
lando mysql -V | grep 5.7
46+
lando mysql -V | grep 8.0
4747

4848
# Should not enable xdebug by default
4949
cd wordpress

examples/wordpress-mysql8/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Run the following commands to validate things are rolling as they should.
3232
cd mysql8
3333
lando exec appserver -- curl -L localhost | grep "WordPress"
3434

35-
# Should use 7.4 as the default php version
35+
# Should use 8.3 as the default php version
3636
cd mysql8
37-
lando php -v | grep "PHP 7.4"
37+
lando php -v | grep "PHP 8.3"
3838

3939
# Should be running apache 2.4 by default
4040
cd mysql8
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: wordpress-recommended
2+
recipe: wordpress
3+
config:
4+
php: '8.3'
5+
database: mysql:8.0
6+
7+
# do not remove this
8+
plugins:
9+
"@lando/wordpress": ../..
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# WordPress Recommended Example
2+
3+
This example exists primarily to test the following documentation:
4+
5+
* [WordPress Recipe - Configuration](https://docs.lando.dev/wordpress/config.html)
6+
7+
This example uses the WordPress.org recommended versions of PHP and MySQL.
8+
9+
## Start up tests
10+
11+
Run the following commands to get up and running with this example.
12+
13+
```bash
14+
# Should start up successfully
15+
lando poweroff
16+
lando start
17+
```
18+
19+
## Verification commands
20+
21+
Run the following commands to validate things are rolling as they should.
22+
23+
```bash
24+
# Should use php 8.3
25+
lando php -v | grep "PHP 8.3"
26+
27+
# Should be running mysql 8.0
28+
lando mysql -V | grep 8.0
29+
30+
# Should be running apache by default
31+
lando exec appserver -- apachectl -V | grep 2.4
32+
lando exec appserver -- curl -IL localhost | grep Server | grep 2.4
33+
34+
# Should be able to connect to the database with the default creds
35+
lando mysql -uwordpress -pwordpress wordpress -e quit
36+
37+
# Should have the 2.x wp-cli
38+
lando wp cli version | grep "WP-CLI 2."
39+
```
40+
41+
## Destroy tests
42+
43+
Run the following commands to trash this app like nothing ever happened.
44+
45+
```bash
46+
# Should be destroyed with success
47+
lando destroy -y
48+
lando poweroff
49+
```

inits/wordpress.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
'use strict';
22

33
/*
4-
* Init Lamp
4+
* Init WordPress
55
*/
66
module.exports = {
77
name: 'wordpress',
8+
defaults: {
9+
'php': '8.3',
10+
'database': 'mysql:8.0',
11+
},
812
};

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@lando/mssql": "^1.4.3",
4848
"@lando/mysql": "^1.6.0",
4949
"@lando/nginx": "^1.5.0",
50-
"@lando/php": "^1.11.0",
50+
"@lando/php": "^1.11.1",
5151
"@lando/postgres": "^1.5.0",
5252
"lodash": "^4.17.21"
5353
},

0 commit comments

Comments
 (0)