Kirby APCu cache at Dreamhost

Could someone explain if kirby’s APC cache will work in php5.6?

It looks like PHP5.6 uses OPCache instead…

Any idea if OPcache actually works with kirby?

Any insights on kirby’s caching other than the following link would be appreciated

OPcache only caches PHP code, not data. APC did that as well in the past, but is no longer compatible with newer PHP versions (well, because PHP already does that by itself now).

The user cache from the APC extension has therefore been extracted into the APCu extension, which is a drop-in replacement for APC.
You need to install this extension manually and can then set c::set('cache.driver', 'apc') to use it for the Kirby cache.

I saw that homebrew has it, so ok on my local environment but I can’t find a single place explaining how to install APCu on Dreamhost…

I’m quite lost… not even sure if Dreamhost allows it… I guess they do since they allow OPcache and APC.

[edit]
https://serverpilot.io/community/articles/how-to-install-the-php-apcu-extension.html
but it looks like one needs root privileges… not on my humble shared server account :frowning:

They have a wiki page on APC. APCu should work in a similar way, but you need to change the download URL and the path to PHP of course. :slightly_smiling:

I’ve read that wiki… but this never occurred me… must be too tired.

Will give it a try tomorrow!

Thanks Lukas

YES… managed to install APCu on a shared hosting account on Dreamhost.

Like Lukas instructed… I’ve just adapted the procedures from the wiki page

My process is below in case anyone needs it:

apcu-4.0.10 is the (last) version compatible with php5.6 (when this was posted)

#connects via ssh / at home folder
$ wget https://pecl.php.net/get/apcu-4.0.10.tgz
$ tar xvf apcu-4.0.10.tgz
$ cd apcu-4.0.10
$ /usr/local/php56/bin/phpize
$ ./configure --with-php-config=/usr/local/php56/bin/php-config; make
$ cp ~/apcu-4.0.10/modules/apcu.so $HOME


# The phprc file is located at $HOME/.php/5.6/phprc
# add the following line to it:
extension = /home/YOURHOME/apcu.so


# Kill running PHP processes
killall -9 php56.cgi

The php info:

1 Like

Thanks for sharing. :slight_smile:

1 Like