How to Install the Memcached PHP Extension on CentOS 7
Memcached is a distributed, high-performance, in-memory caching system that is primarily used to speed up sites that make heavy use of databases. It can, however, be used to store objects of any kind. Nearly every popular CMS has a plugin or module to take advantage of Memcached, and many programming languages have a Memcached library, including PHP, Perl, Ruby, and Python. Memcached runs in memory and is thus quite speedy since it does not need to write data to disk.
- These instructions are intended specifically for installing the Memcached PHP Extension on a single CentOS 7 node.
- I’ll be working from a Liquid Web Core Managed CentOS 7 server, and I’ll be logged in as root.
- Follow our tutorial on How to Install Memcached on CentOS 7 prior to this KB!
First, clean-up yum:
yum clean all
As a matter of best practice we’ll update our packages:
yum -y update
Then installing PHP Memcached extension and related packages is now as simple as running just one command::
yum -y install php-pecl-memcache
Restart memcached and httpd:
systemctl restart memcached
systemctl restart httpd
Use the following command to view information on the installed PHP modules:
php -m | grep memcache
And look for a response similar to:
memcache
You can also verify the configuration of PHP with phpinfo. Follow our tutorial: How To: Check PHP Modules With phpinfo
Related Articles:
- How to Install Adminer MySQL Database Management Tool on AlmaLinux
- How to Edit the PHP Memory for Your WordPress Site via WP Toolkit
- 4 Methods for How to Install Yarn on Windows Server
- How to Install Bpytop Resource Monitoring Tool on AlmaLinux
- How to Fix “This Site Can’t Provide a Secure Connection” Error
- How to Install MongoDB on AlmaLinux

About the Author: J. Mays
As a previous contributor, JMays shares his insight with our Knowledge Base center. In our Knowledge Base, you'll be able to find how-to articles on Ubuntu, CentOS, Fedora and much more!
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
How to Install Adminer MySQL Database Management Tool on AlmaLinux
Read ArticleWhat is CGI-Bin and What Does it Do?
Read ArticleTop 10 Password Security Standards
Read ArticleTop 10 Password Security Standards
Read ArticleHow to Use the WP Toolkit to Secure and Update WordPress
Read Article