From 11b1480d1b9680cc3857a897276ccb281f72d6da Mon Sep 17 00:00:00 2001 From: Aaron Feledy Date: Sat, 21 Feb 2026 21:41:29 -0600 Subject: [PATCH] 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 --- .github/workflows/pr-wordpress-tests.yml | 1 + CHANGELOG.md | 5 +++ docs/config.md | 41 +++++++++++++------ examples/wordpress-init/README.md | 8 ++-- examples/wordpress-mysql8/README.md | 4 +- examples/wordpress-recommended/.lando.yml | 9 +++++ examples/wordpress-recommended/README.md | 49 +++++++++++++++++++++++ inits/wordpress.js | 6 ++- package-lock.json | 10 ++--- package.json | 2 +- 10 files changed, 110 insertions(+), 25 deletions(-) create mode 100644 examples/wordpress-recommended/.lando.yml create mode 100644 examples/wordpress-recommended/README.md diff --git a/.github/workflows/pr-wordpress-tests.yml b/.github/workflows/pr-wordpress-tests.yml index 62f9f9f..6400abe 100644 --- a/.github/workflows/pr-wordpress-tests.yml +++ b/.github/workflows/pr-wordpress-tests.yml @@ -23,6 +23,7 @@ jobs: - examples/wordpress-mariadb-mysql - examples/wordpress-mysql8 - examples/wordpress-nginx + - examples/wordpress-recommended lando-version: - 3-edge - 3-stable diff --git a/CHANGELOG.md b/CHANGELOG.md index ae82f9e..c1e0b6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/config.md b/docs/config.md index b4a06d6..b84463c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -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 @@ -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' ``` @@ -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 ``` @@ -65,6 +83,8 @@ config: ```yaml recipe: wordpress config: + php: '8.3' + database: mysql:8.0 via: nginx ``` @@ -81,7 +101,8 @@ 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 @@ -89,7 +110,8 @@ config: ```yaml recipe: wordpress config: - database: mariadb + php: '8.3' + database: mariadb:10.6 ``` #### Using Postgres @@ -97,14 +119,7 @@ config: ```yaml recipe: wordpress config: - database: postgres -``` - -#### Using a custom version - -```yaml -recipe: wordpress -config: + php: '8.3' database: postgres:14 ``` @@ -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 diff --git a/examples/wordpress-init/README.md b/examples/wordpress-init/README.md index fb31cbf..9ab7e21 100644 --- a/examples/wordpress-init/README.md +++ b/examples/wordpress-init/README.md @@ -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 diff --git a/examples/wordpress-mysql8/README.md b/examples/wordpress-mysql8/README.md index 418cc35..77228f9 100644 --- a/examples/wordpress-mysql8/README.md +++ b/examples/wordpress-mysql8/README.md @@ -32,9 +32,9 @@ Run the following commands to validate things are rolling as they should. cd mysql8 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 mysql8 -lando php -v | grep "PHP 7.4" +lando php -v | grep "PHP 8.3" # Should be running apache 2.4 by default cd mysql8 diff --git a/examples/wordpress-recommended/.lando.yml b/examples/wordpress-recommended/.lando.yml new file mode 100644 index 0000000..b7ba30d --- /dev/null +++ b/examples/wordpress-recommended/.lando.yml @@ -0,0 +1,9 @@ +name: wordpress-recommended +recipe: wordpress +config: + php: '8.3' + database: mysql:8.0 + +# do not remove this +plugins: + "@lando/wordpress": ../.. diff --git a/examples/wordpress-recommended/README.md b/examples/wordpress-recommended/README.md new file mode 100644 index 0000000..94eea42 --- /dev/null +++ b/examples/wordpress-recommended/README.md @@ -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 +``` diff --git a/inits/wordpress.js b/inits/wordpress.js index 72e19a2..fe7b70f 100644 --- a/inits/wordpress.js +++ b/inits/wordpress.js @@ -1,8 +1,12 @@ 'use strict'; /* - * Init Lamp + * Init WordPress */ module.exports = { name: 'wordpress', + defaults: { + 'php': '8.3', + 'database': 'mysql:8.0', + }, }; diff --git a/package-lock.json b/package-lock.json index 3663fa7..af8230f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,14 +6,14 @@ "packages": { "": { "name": "@lando/wordpress", - "version": "1.9.0", + "version": "1.10.0", "license": "MIT", "dependencies": { "@lando/mariadb": "^1.7.0", "@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" }, @@ -1493,9 +1493,9 @@ "license": "MIT" }, "node_modules/@lando/php": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@lando/php/-/php-1.11.0.tgz", - "integrity": "sha512-E2uj58X1+Kk+XYnDhpnl04nR60/lBt/jwhmhNPryis6t9EwMDLDJ8YI8UUjVSxvUL1NbVlYp4X90Rc3EHsWv1g==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@lando/php/-/php-1.11.1.tgz", + "integrity": "sha512-3l6oEj6iZxL4vj59YbOinfu4ktUXYfHe7UlP1W5wePTaQH9K+RBCg8eCsPBmliQzc9ltX6JqvDYrAx2KN5K8Dw==", "bundleDependencies": [ "@lando/nginx", "lodash", diff --git a/package.json b/package.json index ca8050d..8dfb0a7 100644 --- a/package.json +++ b/package.json @@ -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" },