Help Docs Server Administration Linux Server Administration Installing Memcached PHP Extension for CentOS and Fedora

Installing Memcached PHP Extension for CentOS and Fedora

Installing the PHP Extension for Memcached is a simple process, this tutorial will show installation for CentOS and Fedora operating systems. The installation is done through the command line using yum.

Warning:


You must install Memcached on your server before installing the extension. See our article Installing memecached on CentOS 7 and Fedora.


Installing the PHP Extension for Memcached is a simple process, this tutorial will show installation for CentOS and Fedora operating systems. The installation is done through the command line using yum.

  1. First, clean up yum:
    yum clean all

  2. Then make sure your packages are all up to date:
    yum -y update

  3. Now you are ready to install the PHP Memcached extension and related packages:
    yum - y install php-pecl-memcache

  4. To verify the installation of memcached, you’ll want to restart memcached and httpd:
    systemctl restart memcached
    systemctl restart httpd

  5. You can view information on the installed PHP modules with the following command:
    php - m | grep memcache

  6. Look for a response similar to:
    memcache

Was this article helpful?