Windows command line window outputting an error message when starting PHP 8.2 with an outdated version of the APCu extension

APCu 5.1.22 for PHP 8.2 on Windows

Download of the php_apcu.dll binaries

To ensure the highest possible compatibility, we also test the WordPress plugins we develop with older WordPress versions, as well as on different PHP versions. Amongst others, we use a development server with Apache under Windows. When we recently wanted to add the latest PHP version 8.2.x to our repertoire, we encountered a problem with the popular caching extension APCu.

What is APCu?

APCu, short for APC User Cache, is a free PHP extension that provides a data cache to improve the performance of PHP applications. It stores data fragments in memory so that they can be retrieved more quickly for repeated requests. This reduces the need to query databases or external data sources again and thus can considerably speed up the loading times of web pages. The data is only persistent as long as the process is running. So it is not necessarily suitable for user data, but explicitly for caching, where it is not too bad if this cache has to be rebuilt from time to time (for example, after a server restart).

The problem

After the update, we received the following error message when starting PHP:


Warning: PHP Startup: apcu: Unable to initialize module
Module compiled with module API=20210902
PHP    compiled with module API=20220829
These options need to match

A look at the official PECL download page for APCu 5.1.22, which brings compatibility with PHP 8.2, was sobering: unlike the previous version 5.1.21, no downloads of the required DLL file were available. Our research led us to numerous forum posts and GitHub issues, including this issue in the official repository and this StackOverflow post with the title Missing php_apcu.dll for PHP 8.2 / APCu 5.1.22. Unfortunately, the links to more recent dev versions of php_apcu.dll contained there were no longer valid in the meantime.

Release 5.1.22 also offers other new features that could also be interesting for systems with PHP versions prior to 8.2. Here is the official changelog:

  • PHP 8.2 compatibility
  • PHP 8.1 compatibility in apc.php
  • Fix --enable-apcu-rwlocks configure option
  • Enable transparent huge pages for mmap memory
  • Use monotonic clock for TTL

Our solution

Since we could not find any other solution, we compiled the DLLs for APCu 5.1.22 Stable under Windows ourselves and would like to share them with the dev community. For all those who are facing the same problem, we offer the DLLs for download here. This is not an unfinished development state of version 5.1.23, but the state of the repository for 5.1.22 Stable.

You want to say thanks? Donate a coffee (or two)!

Important note: Although we have compiled the DLLs based on the official repository, we would like to point out that we cannot be held liable for the functionality and security of these files. We use them ourselves in our development system, but as with any software, they should be tested in a safe environment before being used in a production environment.

PHP 8.2

PHP 8.1

PHP 8.0

PHP 7.4

PHP 7.3