Grav 1.8-beta Released

Paving the way with PHP 8.4 support

3 mins

PHP 8.4 was released today (November 21, 2024), and it's a major release with many new features, but it also deprecates a few functions and methods that have been in PHP for years. What this means is that for Grav to properly support PHP 8.4, Grav itself, as well as many of the packages that Grav depends on, need to be updated to newer versions that use the more modern techniques that have been added to PHP in recent releases (PHP 8.0+).

The current stable release of Grav 1.7 requires PHP 7.3.6, which ended security fix status in December 2021. We can't update to newer libraries that support PHP 8.4 and still maintain support for PHP 7.3, as it would result in breaking compatibility. Enter Grav 1.8.

Grav 1.8, which is currently in a beta release phase, focuses on updating Grav itself to be fully compatible with PHP 8.4 while also updating the underlying supporting libraries to much more recent versions that also support PHP 8.4. This does mean that we have to up our base PHP requirements for Grav 1.7 to PHP 8.2 as this is a good common lowest level that all the required libraries support. PHP 8.2 was released in December 2022, and is actively supported until December 2025, with security updates planned until December 2026.

Grav relies on many great libraries such as various Symfony framework libraries for caching, yaml, http-client, processing, etc., and we can jump from version 4.4 all the way up to the very latest 6.4, taking advantage of fixes and new functionality. Also, we can move from Twig 1 to Twig 2, but unfortunately not to Twig 3. The problem with our Twig requirement is that plugins and themes rely on the ability to use the Twig Defer extension to add CSS/JS assets to themes, but this extension is not compatible (and may never be) with Twig 3. Upgrading to Twig 3 would effectively break every Grav site, so until we have a suitable solution, we cannot entertain a move to Twig 3.

Along with updates to Grav itself, quite a few other plugins will require updating to fully support PHP 8.4. The good news is that this can usually be handled with code that is backwards compatible even down to PHP 7.3, so this is a fairly clean process. Quite a few plugins have already been released with these PHP 8.4 fixes in preparation for Grav 1.8's final release.

Please help us out by testing the beta release on a 'copy' of you sites. It's not recommend for use in production yet, however i've been daily driving Grav 1.8 beta for the past few months and have been fixing issues in it, and plugins and themes as I find them. But I alone cannot test every situation that might arise, I need your help to ensure that 1.8 is thoroughly tested before it gets a stable release.

Check out the Download Grav page and try out the latest 1.8.0 beta release available.

I will be putting together an upgrade document for developers for Grav 1.8 to outline a few and relatively simple solutions to issues you might run across in your plugins that will be required in order to fully support Grav 1.8 specifically but also PHP 8.4 in general. So stay tuned for that coming soon!

Thanks!

-- Andy Miller (Grav Maintainer + Lead Developer)

Grav Premium
Turbo-charge your Grav site - from the creators of Grav