Current versions of MAMP come with an interface for enabling/disabling Memcached. As such, some of the above steps from 3.x no longer apply.
tl;dr
for some reason, you have to tell PHP about memcached even if activated via the GUI.
- Add the following to the end of the desired version via the php.ini:
extension=memcached.so
- Grab a copy of
object-cache.php
from here.
- Move
object-cache.php
to the wp-content
of your project.
- Start/Restart MAMP with Memecached enabled.
$cash_money = wp_cache_get( '_cache_testing_101', '_testing_group' );
if ( false === $cash_money ) {
$cash_money = wp_cache_set( '_cache_testing_101', 'π', '_testing_group', 60 );
echo 'cache: fail π';
} else {
echo 'cache: pass ' . $cash_money ;
}