I want to be able to cash database requests/results.
I would like to use APCu for this, how do I make that happen?
(Windows 11)
There is an old topic from Mars 2024 asking basically the same thing: Manual install php extension
But here the member of the WP Engine Team finds the wrong information and thinks APCu is no longer supported.
(It’s the APCu-bc that is no longer supported (from PHP 8.0.0) - the backwards compability for the old APC (APC without “u”).)
I figured it out. This will probably work for any extension you want to install on a Windows machine, but I have only tried with the APCu.
In your Local WP Site Overview Window
Click the ”Details”-link on the PHP version row. This opens a page of information about the php-installation that Local WP is running.
Find the following information:
a) PHP version
b) Architecture (x86 or x64 bit system)
c) File path to the php.ini-file, see “Loaded Configuration File”
d) Thread Safety (disabled or enabled)
Find and download the correct DLL-file
Using the information you just got you can find the correct DLL-file to download - somewhere on the internet…
If you are looking for the APCu-extension you can find those here: https://pecl.php.net/package/APCu
(.tgz file is for mac and DLL is for windows, I picked the latest version)
Make sure you pick the DLL-file that will fit your system and PHP version. Find the PHP-version you’re using in the list and if you have a x64 bit system you pick the x64-version of those DLL files.
If Thread Safety is disabled, which it was for me, you pick the NTS version.
All we need from the zip-file that will be downloaded is the file that ends with .dll
On your system
3. Open the php.ini file in any text editor.
4. In the top rows of the php.ini file you will find the file path to the extension folder the Local WP instance is currently running. Look for the path after: “extension_dir”=
5. Go to that folder (easiest way is to copy the file path and paste it in an explorer window)
6. Drop the DLL-file in the folder.
7. Copy the name of the DLL-file, for example: php_apcu.dll
In your Site Folder
8. Open your site folder.
If you don’t know where it is, you can find it from the Local WP Site Overview Window by clicking “Site folder” right under the head title.
9. Go into the folder conf and then the folder php (conf/php).
10. Open the file php.ini.hbs in any text editor.
11. Scroll down and find where extensions are being loaded (hint: ; Load extensions )
12. Add a new extension-row with the name of the DLL-file you added in the extension folder at step 6. For me the new row looks like this: extension=php_apcu.dll
13. Save the file!
Back to Local WP Site Overview Window
14. Restart your site and cross fingers that it worked.