diff --git a/CHANGELOG.md b/CHANGELOG.md index ceb3d2d0..dfc547d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Enabled `mod_headers` and `mod_expires` Apache modules by default [#243](https://github.com/lando/php/issues/243) * Fixed xdebug log file ownership issue when `build_as_root` or `run_as_root` creates `/tmp/xdebug.log` as root [#242](https://github.com/lando/php/pull/242) ## v1.11.2 - [February 25, 2026](https://github.com/lando/php/releases/tag/v1.11.2) diff --git a/builders/php.js b/builders/php.js index 5745f1b1..3d1ebf4b 100644 --- a/builders/php.js +++ b/builders/php.js @@ -170,7 +170,7 @@ module.exports = { '/helpers', ], confSrc: path.resolve(__dirname, '..', 'config'), - command: ['sh -c \'a2enmod rewrite && apache2-foreground\''], + command: ['sh -c \'a2enmod rewrite headers expires && apache2-foreground\''], composer_version: true, phpServer: 'apache', defaultFiles: { diff --git a/examples/8.4/.htaccess b/examples/8.4/.htaccess new file mode 100644 index 00000000..a26e0808 --- /dev/null +++ b/examples/8.4/.htaccess @@ -0,0 +1,8 @@ + + Header set X-Lando-Test "blazes" + + + + ExpiresActive On + ExpiresDefault "access plus 1 hour" + diff --git a/examples/8.4/README.md b/examples/8.4/README.md index adcc5350..cbe81b00 100644 --- a/examples/8.4/README.md +++ b/examples/8.4/README.md @@ -49,6 +49,12 @@ lando exec defaults -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q lando php -i | grep memory_limit | grep -e "-1" lando exec defaults -- php -i | grep "memory_limit" | grep -e "-1" +# Should have mod_headers enabled and working +lando exec defaults -- curl -sI http://localhost | grep -i "X-Lando-Test: blazes" + +# Should have mod_expires enabled and working +lando exec defaults -- curl -sI http://localhost | grep -i "Expires:" + # Should not enable xdebug by default lando exec defaults -- php -m | grep xdebug || echo $? | grep 1