Memcached
Memcached is an in-memory key-value store for small chunks of arbitrary data. The Memcached and igbinary PHP extensions are added to your PHP configuration when Memcached is enabled in your server settings.

When the Memcached server is enabled, the following section appears in phpInfo (WebStart › Tools → phpInfo in the MAMP PRO interface), showing the available configuration options.

In the upper right corner of this screen you will find information about the version of the Memcached server and the port used.
-
Use Memcached server
Select this checkbox if you want the Memcached server to start and stop automatically when the Start/Stop button in the toolbar is clicked. The Memcached PHP extension is automatically included when this option is enabled. -
Allow network access to Memcached
Select this checkbox if you want to access the Memcached server over the network. Otherwise, you will not be able to access your Memcached server over the network, even from other locally installed programs. If this checkbox is enabled, the Memcached server will not be accessible via socket. -
Maximum memory usage:
Here you can set the size of the maximum available memory. -
Log level:
Select how much information should be written to the Memcached log. The following options are available:Name Content Verbose errors, warnings Very Verbose errors, warnings, client commands, responses Extremely Verbose errors, warnings, client commands, responses, internal transitions -
Log file:
The path to your Memcached log file.- Choose…
Here you can choose the directory and the file name. By default, this log file is located at/Applications/MAMP/logs/memcached_error.log.
- Choose…
Examples
Section titled “Examples”The following examples show how to connect to the Memcached server using PHP — either through a UNIX socket or over the network. In each example, a value (“MAMP PRO”) is stored in the cache and then retrieved.
PHP (Connect using a UNIX socket)
Section titled “PHP (Connect using a UNIX socket)”<?php
/* Note: The checkbox "Use Memcached server" must be activated under "Settings › Server › Memcached". */
$memcached = new Memcached();
// Socket $memcached->addServer('/Applications/MAMP/tmp/memcached.sock', 0);
$version = $memcached->getVersion(); echo '<pre>'; print_r($version); echo '</pre>';
$memcached->set('Key1', 'MAMP PRO'); $result = $memcached->get('Key1'); echo $result;
?>PHP (Connect via network)
Section titled “PHP (Connect via network)”<?php
/* Note: The checkbox "Use Memcached server" must be activated under "Settings › Server › Memcached". */
$memcached = new Memcached();
// Network // "Allow network access to Memcached" must be activated. // You can set the host to either "127.0.0.1" or "localhost". $memcached->addServer('127.0.0.1', 11211);
$version = $memcached->getVersion(); echo '<pre>'; print_r($version); echo '</pre>';
$memcached->set('Key1', 'MAMP PRO'); $result = $memcached->get('Key1'); echo $result;
?>