{"id":1538,"date":"2022-07-08T07:59:39","date_gmt":"2022-07-08T07:59:39","guid":{"rendered":"https:\/\/pheonixsolutions.com\/knowledge-base\/?p=1538"},"modified":"2022-07-08T08:07:29","modified_gmt":"2022-07-08T08:07:29","slug":"how-to-setup-memcached-on-cpanel-whm","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/","title":{"rendered":"How To Setup Memcached on cPanel-WHM"},"content":{"rendered":"\n<p>This article will guide you on how to set up and configure Memcached on cPanel-WHM (RHEL 6\/7 or&nbsp; CentOS 6\/7).<\/p>\n\n\n\n<p>Add EasyApache4 (EA4) Experimental Repository in order to install Memcached. Unfortunately, both Memcached and Memcache RPMs are still in an experimental repo on cPanel-WHM.<\/p>\n\n\n\n<p>So it might not be suitable for a shared hosting environment. Additionally, the Memcached and Memcache PHP extensions in cPanel-WHM are only available for PHP 5.4, PHP 5.5., PHP 5.6, PHP 7.0, and PHP 7.1.<\/p>\n\n\n\n<p>So, both Memcached and Memcache since 2016 are not yet available for cPanel-WHM PHP 7.2, PHP 7.3, and upcoming PHP 7.4.<\/p>\n\n\n\n<p>However, if you use cPanel-WHM on your own cloud server or dedicated server, you might be interested in trying to use Memcached as a database caching for your site.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Prerequisite<\/h1>\n\n\n\n<p>A WHM server with&nbsp; root access to connect the terminal<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Implementation<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">1. Add EasyApache4 Experimental Repository<\/h3>\n\n\n\n<p>We need to add the EA4 experimental repo to&nbsp; CentOS 7 system<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$ yum install ea4-experimental -y<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2. Install Memcached Daemon<\/h3>\n\n\n\n<p>To install Memcached daemon on the system run the following command in the terminal<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$ yum install ea-memcached -y<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">3. Install Memcached and Memcache PHP Extensions<\/h3>\n\n\n\n<p>Install Memcached and Memcache PHP Extensions for PHP 5.4 \u2013 PHP 7.1.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$ yum install ea-php54-php-memcache ea-php54-php-memcached ea-php55-php-memcache ea-php55-php-memcached ea-php56-php-memcache ea-php56-php-memcached ea-php70-php-memcache ea-php70-php-memcached ea-php71-php-memcache ea-php71-php-memcached -y<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">4. Configuring Memcached<\/h3>\n\n\n\n<p>We can customize the Memcached configuration in order to get the best performance for the cPanel-WHM server.<\/p>\n\n\n\n<p>CACHE SIZE is a maximum amount of memory allocation that will be consumed by Memcached for object storage. While MAXCONN is the maximum number of simultaneous connections allowed by Memcached.<br><br><strong>NOTE: &nbsp; Default Value for MAXCONN is 1024 and CACHESIZE 64<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$ nano \/etc\/sysconfig\/memcached<br>======<br>Edit the following lines then save and exit the file&nbsp;<br>=======<br><br>PORT=&#8221;11211&#8243;USER=&#8221;memcached&#8221;MAXCONN=&#8221;2048&#8243;CACHESIZE=&#8221;256&#8243;OPTIONS=&#8221;-l 127.0.0.1,::1&#8243;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">5. Edit .ini Configuration File for Memcache and Memcached<\/h3>\n\n\n\n<p>Finally, we must edit both memcache.ini and memcached.ini in order to enable this PHP extension.<br>Depending on the PHP version the locations of memcache.ini and memcached.ini files will be changed.<br>Note: we should uncomment session.save_handler and session.save_path.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$ nano \/opt\/cpanel\/ea-php71\/root\/etc\/php.d\/memcache.ini<br>$ nano \/opt\/cpanel\/ea-php71\/root\/etc\/php.d\/memcached.ini<br>$ nano \/opt\/cpanel\/ea-php70\/root\/etc\/php.d\/memcache.ini<br>$ nano \/opt\/cpanel\/ea-php70\/root\/etc\/php.d\/memcached.ini<br>$ nano \/opt\/cpanel\/ea-php56\/root\/etc\/php.d\/memcache.ini<br>$ nano \/opt\/cpanel\/ea-php56\/root\/etc\/php.d\/memcached.ini<br>$ nano \/opt\/cpanel\/ea-php55\/root\/etc\/php.d\/memcache.ini<br>$ nano \/opt\/cpanel\/ea-php55\/root\/etc\/php.d\/memcached.ini<br>$ nano \/opt\/cpanel\/ea-php54\/root\/etc\/php.d\/memcache.ini<br>$ nano \/opt\/cpanel\/ea-php54\/root\/etc\/php.d\/memcached.ini<br><br>=====<br>Uncomment the following lines<br>=====<br><br><br>session.save_handler = &#8220;memcache&#8221;<br>session.save_path = &#8220;tcp:\/\/localhost:11211&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">6. Restart Services<\/h3>\n\n\n\n<p>Restart the following services<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>$ service memcached restart<br>$ chkconfig memcached on<br>$ service httpd restart<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This article will guide you on how to set up and configure Memcached on cPanel-WHM (RHEL 6\/7 or&nbsp; CentOS 6\/7). Add EasyApache4 (EA4) Experimental Repository in order to install Memcached. Unfortunately, both Memcached and Memcache RPMs are still in an experimental repo on cPanel-WHM. So it might not be suitable for a shared hosting environment. ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[33],"tags":[162],"class_list":["post-1538","post","type-post","status-publish","format-standard","hentry","category-whm","tag-memcached"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Setup Memcached on cPanel-WHM - PheonixSolutions Knowledge-Base<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Setup Memcached on cPanel-WHM - PheonixSolutions Knowledge-Base\" \/>\n<meta property=\"og:description\" content=\"This article will guide you on how to set up and configure Memcached on cPanel-WHM (RHEL 6\/7 or&nbsp; CentOS 6\/7). Add EasyApache4 (EA4) Experimental Repository in order to install Memcached. Unfortunately, both Memcached and Memcache RPMs are still in an experimental repo on cPanel-WHM. So it might not be suitable for a shared hosting environment. ..Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/\" \/>\n<meta property=\"og:site_name\" content=\"PheonixSolutions Knowledge-Base\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-08T07:59:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-08T08:07:29+00:00\" \/>\n<meta name=\"author\" content=\"knowledge-base\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"knowledge-base\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2022\\\/07\\\/08\\\/how-to-setup-memcached-on-cpanel-whm\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2022\\\/07\\\/08\\\/how-to-setup-memcached-on-cpanel-whm\\\/\"},\"author\":{\"name\":\"knowledge-base\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#\\\/schema\\\/person\\\/24ddfd756e23cf1ce3c8e5f0fb309e6b\"},\"headline\":\"How To Setup Memcached on cPanel-WHM\",\"datePublished\":\"2022-07-08T07:59:39+00:00\",\"dateModified\":\"2022-07-08T08:07:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2022\\\/07\\\/08\\\/how-to-setup-memcached-on-cpanel-whm\\\/\"},\"wordCount\":479,\"commentCount\":0,\"keywords\":[\"Memcached\"],\"articleSection\":[\"WHM\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2022\\\/07\\\/08\\\/how-to-setup-memcached-on-cpanel-whm\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2022\\\/07\\\/08\\\/how-to-setup-memcached-on-cpanel-whm\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2022\\\/07\\\/08\\\/how-to-setup-memcached-on-cpanel-whm\\\/\",\"name\":\"How To Setup Memcached on cPanel-WHM - PheonixSolutions Knowledge-Base\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#website\"},\"datePublished\":\"2022-07-08T07:59:39+00:00\",\"dateModified\":\"2022-07-08T08:07:29+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#\\\/schema\\\/person\\\/24ddfd756e23cf1ce3c8e5f0fb309e6b\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2022\\\/07\\\/08\\\/how-to-setup-memcached-on-cpanel-whm\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2022\\\/07\\\/08\\\/how-to-setup-memcached-on-cpanel-whm\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/2022\\\/07\\\/08\\\/how-to-setup-memcached-on-cpanel-whm\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Setup Memcached on cPanel-WHM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#website\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/\",\"name\":\"PheonixSolutions Knowledge-Base\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/#\\\/schema\\\/person\\\/24ddfd756e23cf1ce3c8e5f0fb309e6b\",\"name\":\"knowledge-base\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7203df2304073f631b2bf04267130cc48b8b1a82bb0ec98285125d6bc3cb8ade?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7203df2304073f631b2bf04267130cc48b8b1a82bb0ec98285125d6bc3cb8ade?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7203df2304073f631b2bf04267130cc48b8b1a82bb0ec98285125d6bc3cb8ade?s=96&d=mm&r=g\",\"caption\":\"knowledge-base\"},\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/knowledge-base\\\/author\\\/knowledge-base\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Setup Memcached on cPanel-WHM - PheonixSolutions Knowledge-Base","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/","og_locale":"en_US","og_type":"article","og_title":"How To Setup Memcached on cPanel-WHM - PheonixSolutions Knowledge-Base","og_description":"This article will guide you on how to set up and configure Memcached on cPanel-WHM (RHEL 6\/7 or&nbsp; CentOS 6\/7). Add EasyApache4 (EA4) Experimental Repository in order to install Memcached. Unfortunately, both Memcached and Memcache RPMs are still in an experimental repo on cPanel-WHM. So it might not be suitable for a shared hosting environment. ..Read more","og_url":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/","og_site_name":"PheonixSolutions Knowledge-Base","article_published_time":"2022-07-08T07:59:39+00:00","article_modified_time":"2022-07-08T08:07:29+00:00","author":"knowledge-base","twitter_card":"summary_large_image","twitter_misc":{"Written by":"knowledge-base","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/#article","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/"},"author":{"name":"knowledge-base","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#\/schema\/person\/24ddfd756e23cf1ce3c8e5f0fb309e6b"},"headline":"How To Setup Memcached on cPanel-WHM","datePublished":"2022-07-08T07:59:39+00:00","dateModified":"2022-07-08T08:07:29+00:00","mainEntityOfPage":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/"},"wordCount":479,"commentCount":0,"keywords":["Memcached"],"articleSection":["WHM"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/","url":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/","name":"How To Setup Memcached on cPanel-WHM - PheonixSolutions Knowledge-Base","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#website"},"datePublished":"2022-07-08T07:59:39+00:00","dateModified":"2022-07-08T08:07:29+00:00","author":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#\/schema\/person\/24ddfd756e23cf1ce3c8e5f0fb309e6b"},"breadcrumb":{"@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/2022\/07\/08\/how-to-setup-memcached-on-cpanel-whm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pheonixsolutions.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"How To Setup Memcached on cPanel-WHM"}]},{"@type":"WebSite","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#website","url":"https:\/\/pheonixsolutions.com\/knowledge-base\/","name":"PheonixSolutions Knowledge-Base","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pheonixsolutions.com\/knowledge-base\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/pheonixsolutions.com\/knowledge-base\/#\/schema\/person\/24ddfd756e23cf1ce3c8e5f0fb309e6b","name":"knowledge-base","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7203df2304073f631b2bf04267130cc48b8b1a82bb0ec98285125d6bc3cb8ade?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7203df2304073f631b2bf04267130cc48b8b1a82bb0ec98285125d6bc3cb8ade?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7203df2304073f631b2bf04267130cc48b8b1a82bb0ec98285125d6bc3cb8ade?s=96&d=mm&r=g","caption":"knowledge-base"},"url":"https:\/\/pheonixsolutions.com\/knowledge-base\/author\/knowledge-base\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/1538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/comments?post=1538"}],"version-history":[{"count":4,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/1538\/revisions"}],"predecessor-version":[{"id":1543,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/1538\/revisions\/1543"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=1538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/categories?post=1538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/knowledge-base\/wp-json\/wp\/v2\/tags?post=1538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}