Step 1 – Install Memcached on Debian
Update apt package cache on your system and then install Memcached on Debian system. Execute below commands on the terminal in your Debian system.
Step 2 – Memcached Configuration
You can find the details information about Memcache configuration here. For inital level configuration check for the following settings under Memcache configuration file /etc/memcached.conf.
-d => Run Memcached in deamon mode. -m => Maximum memory to be used by Memcached. (default: 64 MB) -p => Define port for Memcached. (default: 11211) -l => Define IP address to listen on. Use 0.0.0.0 to listen on all IPs(enterfaces).
After making changes, restart the Memcached service.
Step 3 – Test Memcached Setup
Use nc command to check Memcached status. This will show you the current statistics of running Memcached server. So the values may differ per installation.
Step 4 – Install Memcached PHP Extension
Execute the following command to install PHP Memcached extension on your system. After completing the installation, you must restart the Apache service to reload all settings. All done, You can now test Memcache PHP extension is enabled and working properly by creating an info.php file using the following code.
Now copy info.php file on Apache document root and access on the web interface. Search for the Memcache, You will get the result like below.