How to Install Memcached on cPanel Server Print

  • 7

Install Memcache on CentOS (WHM/cPanel)
  1. Step 1: Login into your WHM panel and using easyapache2 to enable Memcache.
  2. Step 2: SSH into your server and fire this command yum install Memcached. ...
  3. Step 3: Go to Software -> Module Installers -> PHP Pecl, Search for Memcache, and then install both Memcache & Memcached.
  4. Step 4: Restart apache once, using the command: service httpd restart

If Memcached is not available in easyapache2 then follow the below step to install Memcache via command line.

For Memcached installation on cPanel please see below step:

SSH into your server

# yum install memcached

Then, start Memcached service

# service memcached start


[email protected] [~]# service memcached start
Starting memcached: [ OK ]

Then, install PHP Memcache

# pecl install memcache


We can install Memcache from the source by following the steps below:

# wget
# cd memcache (hit tab to fill out the version number)
# phpize

Then, you can see something like this:

# phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
# ./configure
# make
#make install

Make sure the Memcache module is present in the php.ini file. If not, add the Memcache extension in the php.ini file.

# echo "" >> /usr/local/lib/php.ini

Finally, restart Apache

# service httpd restart

Make sure Memcached will be up even after a server reboot:

# chkconfig --levels 235 memcached on

How to check if Memcache is installed or not?

[email protected] [~]# php -m | grep memcache

All Done! If everything goes well, You should now be able to use Memcached within your application.

Was this answer helpful?

« Back

Powered by WHMCompleteSolution