---
title: "Installing Memcached PHP Extension for CentOS and Fedora"
source: "https://docs.nexcess.com/hosting/server-administration/linux/installing-memcached-php-extension-for-centos-and-fedora/"
description: "Installing the PHP Extension for Memcached is a simple process, this tutorial will show installation for CentOS and Fedora operating systems. The installation i…"
vertical: "Hosting"
date: "2024-03-04"
last_modified: "2026-07-29"
---

# Installing Memcached PHP Extension for CentOS and Fedora

| ### **Warning:** |
|---|
| You must install Memcached on your server before installing the extension. See our article [Installing memecached on CentOS 7 and Fedora](https://docs.nexcess.com/hosting/server-administration/linux/installing-memcached-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<br></br>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
    ```
